-
Notifications
You must be signed in to change notification settings - Fork 740
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
DeprecationWarning: builtin type X has no __module__ attribute #1298
Comments
This does seem to be the trend with the issue when re-producing, when exposed to the module this error goes away. Only when you dont expose it directly does this warning get raised from my findings |
This appears to cause an error when running doctests:
It can be worked around by setting |
"__module__ is the name of the module the function was defined in or None if unavailable" https://docs.python.org/3/reference/datamodel.html So perhaps the __module__ attribute should be set to None if the pyclass is not added to a module? |
That sounds like a valid solution, though it's not super clear how to do that correctly with |
@bderrett am I right in thinking this is a new regression for PyO3 0.13? It's quite possibly related to the abi3 work / switch to heap types. |
@davidhewitt Yes. A bisection shows that it was introduced when the "PyO3/abi3" branch was merged. |
On Python 3.7 and up I see warnings of the following form when running the pyo3 test suite:
I think this is probably related to using a
#[pyclass]
when not adding it to a module. I haven't investigated yet.Example test which demonstrates this issue:
I'm not sure what changes we need to make to resolve.
The text was updated successfully, but these errors were encountered: