Skip to content
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

Add IsNone and None static attribute for PyObject #148

Merged
merged 14 commits into from
Aug 21, 2024
Merged

Add IsNone and None static attribute for PyObject #148

merged 14 commits into from
Aug 21, 2024

Conversation

tonybaloney
Copy link
Owner

Should reduce the number of object allocations on the C# side and also this is a more convenient way to get a None value to pass to Python.

@tonybaloney
Copy link
Owner Author

Cc @AaronRobinsonMSFT I think this is what you were suggesting. Can you have a look at the Immortal object implementation please.

@tonybaloney tonybaloney marked this pull request as ready for review August 21, 2024 04:24
src/CSnakes.Runtime/Python/Interns/ImmortalPyObject.cs Outdated Show resolved Hide resolved
src/CSnakes.Runtime/Python/Interns/PyNoneObject.cs Outdated Show resolved Hide resolved
src/CSnakes.Runtime/Python/PyObject.cs Outdated Show resolved Hide resolved
src/CSnakes.Runtime/Python/PyObject.cs Outdated Show resolved Hide resolved
Copy link
Collaborator

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

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

Yep, this is precisely what I was thinking.

src/CSnakes.Runtime/Python/Interns/PyNoneObject.cs Outdated Show resolved Hide resolved
src/CSnakes.Runtime/Python/PyObject.cs Outdated Show resolved Hide resolved
tonybaloney and others added 8 commits August 21, 2024 14:50
@tonybaloney tonybaloney merged commit ec90c9c into main Aug 21, 2024
25 checks passed
@tonybaloney tonybaloney deleted the nunnery branch August 21, 2024 05:33
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.

3 participants