Skip to content

Commit 90e0a6d

Browse files
authored
Merge branch 'master' into patch-1
2 parents 30c7605 + 550a027 commit 90e0a6d

9 files changed

+1077
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
1010
### Added
1111
- Added `clr.GetClrType` (#432, #433)
1212
- Allowed passing `None` for nullable args (#460)
13+
- Added keyword arguments based on C# syntax for calling CPython methods (#461)
1314

1415
### Changed
1516

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ from System.Windows.Forms import Form
4242
a `using (Py.GIL()) {/* Your code here */}` block.
4343
- Import python modules using `dynamic mod = Py.Import("mod")`,
4444
then you can call functions as normal, eg `mod.func(args)`.
45-
- Use `mod.func(args, Py.kw("keywordargname", keywordargvalue))`
45+
- Use `mod.func(args, Py.kw("keywordargname", keywordargvalue))` or `mod.func(args, keywordargname=keywordargvalue)`
4646
to apply keyword arguments.
4747
- All python objects should be declared as `dynamic` type.
4848
- Mathematical operations involving python and literal/managed types must
@@ -67,7 +67,7 @@ static void Main(string[] args)
6767
dynamic a = np.array(new List<float> { 1, 2, 3 });
6868
Console.WriteLine(a.dtype);
6969

70-
dynamic b = np.array(new List<float> { 6, 5, 4 }, Py.kw("dtype", np.int32));
70+
dynamic b = np.array(new List<float> { 6, 5, 4 }, dtype=np.int32);
7171
Console.WriteLine(b.dtype);
7272

7373
Console.WriteLine(a * b);

src/embed_tests/Python.EmbeddingTest.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<Compile Include="TestNamedArguments.cs" />
101101
<Compile Include="TestPyWith.cs" />
102102
<Compile Include="TestRuntime.cs" />
103+
<Compile Include="TestPyScope.cs" />
103104
</ItemGroup>
104105
<ItemGroup>
105106
<ProjectReference Include="..\runtime\Python.Runtime.csproj">

0 commit comments

Comments
 (0)