FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Disable implicit conversions that might lose information by lostmsu · Pull Request #1568 · pythonnet/pythonnet · GitHub

Disable implicit conversions that might lose information - #1568

Merged
lostmsu merged 3 commits into
pythonnet:masterfrom
losttech:disable-auto-conversions
Sep 27, 2021
Merged

Disable implicit conversions that might lose information#1568
lostmsu merged 3 commits into
pythonnet:masterfrom
losttech:disable-auto-conversions

Conversation

lostmsu commented Sep 23, 2021
edited
Loading

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

This removes the following conversions:
PyInt -> int32 (when trying to convert to object only)
.NET arrays and collections -> Python list (due to mutability)

Additionally, PyObject no longer implements IEnumerable<PyObject>, as not all python objects are iterable. Instead, a new class PyIterable is added.

Checklist

  • Make sure to include one or more tests for your change
  • Updated the CHANGELOG

lostmsu force-pushed the disable-auto-conversions branch from 631b019 to c97e5ab Compare September 23, 2021 19:05
lostmsu marked this pull request as ready for review September 23, 2021 20:43
lostmsu added this to the 3.0.0 milestone Sep 24, 2021
Comment thread tests/test_conversion.py
lostmsu force-pushed the disable-auto-conversions branch from 2e8cd3f to b2e6d4e Compare September 27, 2021 21:45
lostmsu merged commit 1ca0bdb into pythonnet:master Sep 27, 2021
lostmsu deleted the disable-auto-conversions branch September 27, 2021 21:52

lostmsu left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

A few minor isssues

Comment thread src/runtime/converter.cs
{
if (setError)
{
Exceptions.SetError(ex.InnerException);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should be just SetError(ex)

Comment thread src/runtime/converter.cs
Comment on lines 363 to 364
return true;
}
// shouldn't happen
return false;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fallback branch should be added.

lostmsu added a commit to losttech/pythonnet that referenced this pull request Sep 27, 2021
lostmsu added a commit to losttech/pythonnet that referenced this pull request Sep 27, 2021
lostmsu added a commit to losttech/pythonnet that referenced this pull request Oct 2, 2021
… point types

arbitrary Python objects are no longer implicitly converted to .NET bool type

this is a continuation of pythonnet#1568
lostmsu added a commit to losttech/pythonnet that referenced this pull request Oct 2, 2021
… point types

arbitrary Python objects are no longer implicitly converted to .NET bool type

this is a continuation of pythonnet#1568
lostmsu added a commit to losttech/pythonnet that referenced this pull request Oct 2, 2021
… point types

arbitrary Python objects are no longer implicitly converted to .NET bool type

this is a continuation of pythonnet#1568
lostmsu added a commit to losttech/pythonnet that referenced this pull request Oct 2, 2021
… point types

arbitrary Python objects are no longer implicitly converted to .NET bool type

this is a continuation of pythonnet#1568
lostmsu added a commit to losttech/pythonnet that referenced this pull request Oct 2, 2021
… point types

arbitrary Python objects are no longer implicitly converted to .NET bool type

this is a continuation of pythonnet#1568
lostmsu added a commit that referenced this pull request Oct 5, 2021
… point types

arbitrary Python objects are no longer implicitly converted to .NET bool type

this is a continuation of #1568
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL