| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 85d0ca6 commit 5f63c67
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,6 +67,9 @@ or the DLL must be loaded in advance. This must be done before calling any other | |||
| 67 | 67 | - BREAKING: disabled implicit conversion from C# enums to Python `int` and back. | |
| 68 | 68 | One must now either use enum members (e.g. `MyEnum.Option`), or use enum constructor | |
| 69 | 69 | (e.g. `MyEnum(42)` or `MyEnum(42, True)` when `MyEnum` does not have a member with value 42). | |
| 70 | + - BREAKING: disabled implicit conversion from Python objects implementing sequence protocol to | ||
| 71 | + .NET arrays when the target .NET type is `System.Object`. The conversion is still attempted when the | ||
| 72 | + target type is a `System.Array`. | ||
| 70 | 73 | - Sign Runtime DLL with a strong name | |
| 71 | 74 | - Implement loading through `clr_loader` instead of the included `ClrModule`, enables | |
| 72 | 75 | support for .NET Core | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -389,11 +389,6 @@ internal static bool ToManagedValue(BorrowedReference value, Type obType, | |||
| 389 | 389 | return true; | |
| 390 | 390 | } | |
| 391 | 391 | ||
| 392 | - if (Runtime.PySequence_Check(value)) | ||
| 393 | - { | ||
| 394 | - return ToArray(value, typeof(object[]), out result, setError); | ||
| 395 | - } | ||
| 396 | - | ||
| 397 | 392 | result = new PyObject(value); | |
| 398 | 393 | return true; | |
| 399 | 394 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -577,6 +577,13 @@ class Foo(object): | |||
| 577 | 577 | ob.ObjectField = Foo | |
| 578 | 578 | assert ob.ObjectField == Foo | |
| 579 | 579 | ||
| 580 | + class PseudoSeq: | ||
| 581 | + def __getitem__(self, idx): | ||
| 582 | + return 0 | ||
| 583 | + | ||
| 584 | + ob.ObjectField = PseudoSeq() | ||
| 585 | + assert ob.ObjectField.__class__.__name__ == "PseudoSeq" | ||
| 586 | + | ||
| 580 | 587 | ||
| 581 | 588 | def test_null_conversion(): | |
| 582 | 589 | """Test null conversion.""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments