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 PyNone to represent Python None #253

Merged
merged 3 commits into from
Mar 5, 2021
Merged

Conversation

markbt
Copy link
Collaborator

@markbt markbt commented Jan 15, 2021

Add a new zero-sized struct PyNone, that represents Python's None. This is
similar to NoArgs for the empty tuple, and is useful for defining functions
or methods that return None in Python.

Add a new zero-sized struct `PyNone`, that represents Python's `None`.  This is
similar to `NoArgs` for the empty tuple, and is useful for defining functions
or methods that return None in Python.
Rather than contructing `py.None()` just to compare against (which
increments and then decrements the refcount on `None`), add a method
on `PyObject` that tests whether the object is the `None` instance.

Use this more widely to reduce the number of `unsafe` blocks.
@markbt markbt merged commit 053bbc6 into dgrunwald:master Mar 5, 2021
@markbt markbt deleted the pynone branch April 15, 2021 14:05
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.

1 participant