Skip to content

Commit aef02e2

Browse files
author
denfromufa
authored
documentation update for keyword arguments (#483)
* documentation update for keyword arguments * Update README.md * Update CHANGELOG.md
1 parent ce14424 commit aef02e2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
99

1010
### Added
1111
- Added clr.GetClrType (#432)(#433)
12-
- Added `Foo` feature
1312
- Allowed passing None for nullable args (#460)
13+
- Added keyword arguments based on C# syntax for calling CPython methods (#461)
14+
1415

1516
### Changed
1617

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);

0 commit comments

Comments
 (0)