-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
annotationlib: namespace can be non-dict
#132426
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
Comments
Signed-off-by: Élie Goudout <eliegoudout@hotmail.com>
However, I now realize that this is a major issue since there might be a conflict between the Shouldn't we separate |
Good point! I think what I'd like to do is drop Your proposed change is a bit dubious because "mapping" at the C level means something a little different (it basically just checks for the
Since instances no longer have accessible annotations by default, this will only be a problem in exotic cases like a Mapping that is also an instance of |
…annotate_function As noted on the issue, making get_annotate_function() support both types and mappings is problematic because one object may be both. So let's add a new one that works with any mapping. This leaves get_annotate_function() not very useful, so remove it.
Hello!
I think the following, made so that
get_annotate_function
is usable in metaclasses'__new__
, should check forMapping
since__prepare__
can provide any mapping (see picture from PEP3115.cpython/Lib/annotationlib.py
Line 630 in a81232c
Linked PRs
get_annotate_function
vs. mapping namespaces #132427The text was updated successfully, but these errors were encountered: