-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Enable py::ellipsis on Python 2 #2360
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I see @ax3l wrote "must be excluded in python 2 tests" in a comment 2 years ago. I'm wondering why, because the Ellipsis object seems to have been there already in Python 2.0.
279a4bd
to
0fd116d
Compare
Thanks for the quick review!
I requested a review from @ax3l as well, but my hypothesis is that @wjakob saw that |
|
Oooooh, nice, OK! That explains a lot. I though I had used it in Python 2 with numpy! |
Yes, it was originally added for NumPy, and was special inside slicing, just like |
Python 2 on Windows failing seems to have been a fluke? |
Windows (maybe 2.7 only) iostreams miss the output once in a while. I think we need to investigate further in the future, but not related to this PR. |
Thanks for the reassurance. Never noticed before, but good to know :-) |
Sounds good to me. |
Oh, I've seen this already. Looks good to me. Feel free to merge. |
Not sure why #1502 disabled
py::ellipsis
for Python 2....
doesn't seem to exist as a shortcut forEllipsis
(the singleton instance of theellipsis
type; similar toNone
andNoneType
), butEllipsis
still exists (https://docs.python.org/2/library/constants.html#Ellipsis), as well as the C Python interface (https://docs.python.org/2/c-api/slice.html#c.Py_Ellipsis).Might not be véry useful in Python 2, but I see no reason not to include it, and it broke some tests in #2349 because I forgot to disable that part of the test for Python 2.