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
Should NamedTuple rely on dict being oredered? #339
Comments
How exactly does it depend on that? IIRC you can trust that the namespace arg to |
@gvanrossum It actually depends on class C:
x: int
y: str then |
Yes, esp. since there are no code changes needed. |
Fixes python/typing#339 Following the discussion on python/typing issue (and taking into account that dict in 3.6 is ordered being an implementation detail) it is proposed to make __annotations__ ordered.
Currently,
NamedTuple
relies on the fact thatdict
is ordered in Python 3.6. However, (if I remember correctly) it was decided at some point that the ordered nature ofdict
is a CPython implementation detail. The question is should we explicitly use anOrderedDict
instead?The text was updated successfully, but these errors were encountered: