-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Change NAMESPACE_BEGIN and NAMESPACE_END macros into PYBIND11_NAMESPACE_BEGIN and PYBIND11_NAMESPACE_END #2283
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
Change NAMESPACE_BEGIN and NAMESPACE_END macros into PYBIND11_NAMESPACE_BEGIN and PYBIND11_NAMESPACE_END #2283
Conversation
…CE_BEGIN and PYBIND11_NAMESPACE_END
This is a no-brainer, feel free to merge once the CI passes. |
So CI is broken. Partially because PyPy is broken since yesterday, like we discussed. The other error is:
|
Sigh. How does Travis keep on changing what's default installed with homebrew?? |
…__init__' error message between CPython and PyPy under the rug
b33874c
to
7a8cc07
Compare
Messages from
So it installed python 3.8, not 3.7. This could explain the error:
|
Homebrew finally finished the Python 3.7 to 3.8 transition, was merged yesterday, so this isn't really Travis' fault. |
Thanks, @bstaletic and @henryiii. Not behind my laptop, currently. Feel free to push a fix to my branch! |
.travis.yml
Outdated
@@ -149,7 +149,7 @@ matrix: | |||
- os: osx | |||
name: Python 3.7, c++14, AppleClang 9, Debug build |
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.
Description is still 3.7
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.
How did I miss that? I'll have to checkout & force push now...
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.
I can do it in a few hours as well!
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.
Done.
Thanks Henry! Something fishy still happened before, btw, because CMake was called with
That's why I didn't look further at HomeBrew's installation... |
|
84eca63
to
7c16b80
Compare
7c16b80
to
681ebc4
Compare
Ah, right, thanks for the explanation! I don't know brew's thát well :) |
Someone could cancel the second to last appveyor run and save this PR ~20 minutes. |
Appveyor doesn't give collaborators access. It's on wjakob's account and we'd need an explicit invitation (which is probably not worth the trouble if we're switching to GHA soon enough). |
@wjakob already approved, so merged. Thanks! |
3 minutes too late to merge! Thanks for the final fixes, @henryiii! |
Hi, I updated from an older pybind to the recent master today and was greeted with a bunch of compiler error messages. If I see it correctly, this is a change that came after the 2.5.0 release so I'm probably ahead of the curve. I couldn't find anything in the docs about it. I would strongly recommend to mention this in the Upgrade Guide https://pybind11.readthedocs.io/en/stable/upgrade.html. Also the typecaster example in the docs https://pybind11.readthedocs.io/en/stable/advanced/cast/custom.html uses the manual Thank you all for working on and improving pybind11, it's one of the most awesome libraries/tools out there! :-) |
I'm actually now wondering what this macro is for - as you still need to specify the actual name of the namespace, e.g.:
I can't see any benefits? It's not shorter (longer even) and you still need to remember and "manually" type the name of the actual namespace, so you might as well just type
It would be useful if you could just do:
In that way, as a user/consumer of pybind11 I don't have to remember what namespace to define my stuff in, and if you pybind11 folks ever decide to change the namespace, my code is future proof. I originally thought that's what the purpose of the macro is, but now see that that's currently not the case. |
This is an undocumented macro, though, so I'm not sure pybind11 is responsible for breaking undocumented stuff? ;-) (Then again, I also don't really know why the macros are actually there?) There's also not a new release yet, and I don't think it's clear yet whether it will be a patch, minor, or major release, so it's hard to write this part of the docs (and anyway, it won't show up on the "stable" version of RTD!). Though I guess it could be a good plan to keep a list of changes to master, there (@henryiii did start a "pending" changelog, I believe).
Not sure why it's there, but there must be a reason?
That wouldn't really make sense, because it's in PS: Expecting @bstaletic to pop up any time now, shouting "Hyrum's law". |
A few thoughts.
I'm honestly surprised that anyone would try to depend on something like That said...
Exactly! |
That's exactly what I thought of when I saw this. :) |
I didn't remember the upgrade guide, thanks! Will make sure CMake related things go in there soon! |
I see! Makes complete sense. I agree then it should not be mentioned in the docs or upgrade guide, as it's internal-use only. I've removed it from my type-casters and changed it to I don't remember why I used that macro or where I found it, but I don't think I was specifically looking for it. If I had to venture a guess I would say that it (mistakenly, in that case) might have been part of some pybind11 example typecaster code somewhere a few years ago, and I copied it from there. But anything is possible. Thanks a lot, and I guess "sorry for using undocumented stuff" :-). |
Thanks for the friendly reminder that we need to start thinking about this upgrade guide ;-) |
Straightforward PR, implementing suggestion from #2199.
Closes #2199.