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 types for None, Ellipsis and NotImplemented #3162

Closed
davidhewitt opened this issue May 18, 2023 · 0 comments · Fixed by #3408
Closed

Add types for None, Ellipsis and NotImplemented #3162

davidhewitt opened this issue May 18, 2023 · 0 comments · Fixed by #3408
Milestone

Comments

@davidhewitt
Copy link
Member

          Rather than returning `PyObject` here it would probably be nicer if we returned `&PyEllipsis`, and created a new struct `types::PyEllipsis`. (Would avoid the need to increase a reference count here.)

That would also mean that x.is_instance::<PyEllipsis>() would just work instead of needing is_ellipsis, which does have the upside of avoiding a special method. Not necessarily saying that it's better, perhaps is_ellipsis is still warranted.

Also, adding types::PyEllipsis would pave the way for instead just having PyEllipsis::get(py) to retrieve the singleton, rather than adding this to Python which I don't think really needs this method.

Originally posted by @davidhewitt in #2911 (comment)

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 a pull request may close this issue.

1 participant