8000 Added IsNone() and GetPyNone() by henon · Pull Request #1137 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Added IsNone() and GetPyNone() #1137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 11, 2020
Merged

Added IsNone() and GetPyNone() #1137

merged 4 commits into from
May 11, 2020

Conversation

henon
Copy link
Contributor
@henon henon commented May 10, 2020

What does this implement/fix? Explain your changes.

IsNone() and GetPyNone() were needed for Numpy.NET to be able to find out if a PyObject is none.

Does this close any currently open issues?

No.

Any other comments?

These are in use for a long time now, I just now figured out how to PR them. I'll commit the necessary things from the checklist below.

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@dnfclas
Copy link
dnfclas commented May 10, 2020

CLA assistant check
All CLA requirements met.

@henon
Copy link
Contributor Author
henon commented May 10, 2020

I have no idea how to add a test and the change is so small that it doesn't really need documentation.

8000

@filmor
Copy link
Member
filmor commented May 10, 2020

I completely get the IsNone, but what do you need the GetPyNone for? It's a bit arbitrary here, isn't it?

@lostmsu
Copy link
Member
lostmsu commented May 10, 2020

@filmor re:GetPyNone it is actually useful. I have it in my branch too. That's the easiest way to pass None.

Though as a static property (and I don't see why it should not be a property).

@henon
Copy link
Contributor Author
henon commented May 10, 2020

You might wanna squash this PR into a single commit.

Copy link
Member
@lostmsu lostmsu left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@filmor filmor merged commit 960286d into pythonnet:master May 11, 2020
@filmor
Copy link
Member
filmor commented May 11, 2020

Thank you :)

AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this pull request Jun 29, 2020
* Add `PyObject.IsNone()`
* Add `Runtime.None` which returns a reference to `None` as a `PyObject` to be able to pass it into Python from .NET
@henon henon deleted the net_framework branch July 31, 2020 14:48
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.

4 participants
0