Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 3 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ or the DLL must be loaded in advance. This must be done before calling any other
- BREAKING: disabled implicit conversion from C# enums to Python `int` and back.
One must now either use enum members (e.g. `MyEnum.Option`), or use enum constructor
(e.g. `MyEnum(42)` or `MyEnum(42, True)` when `MyEnum` does not have a member with value 42).
- BREAKING: disabled implicit conversion from Python objects implementing sequence protocol to
.NET arrays when the target .NET type is `System.Object`. The conversion is still attempted when the
target type is a `System.Array`.
- Sign Runtime DLL with a strong name
- Implement loading through `clr_loader` instead of the included `ClrModule`, enables
support for .NET Core
Expand Down
5 changes: 0 additions & 5 deletions 5 src/runtime/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,6 @@ internal static bool ToManagedValue(BorrowedReference value, Type obType,
return true;
}

if (Runtime.PySequence_Check(value))
{
return ToArray(value, typeof(object[]), out result, setError);
}

result = new PyObject(value);
return true;
}
Expand Down
7 changes: 7 additions & 0 deletions 7 tests/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,13 @@ class Foo(object):
ob.ObjectField = Foo
assert ob.ObjectField == Foo

class PseudoSeq:
def __getitem__(self, idx):
return 0

ob.ObjectField = PseudoSeq()
assert ob.ObjectField.__class__.__name__ == "PseudoSeq"


def test_null_conversion():
"""Test null conversion."""
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.