-
Notifications
You must be signed in to change notification settings - Fork 2
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
ImmutableDict may fail to maintain iteration order on non-CPython implementations of Python 3.6 #52
Comments
Is it as simple as changing
if not DICT_ITERATION_IS_DETERMINISTIC ? There should probably be a keyword argument to bypass this check (like for |
@berquist : Aha, yes, you are correct (on both counts) |
This all sounds good, just make sure that if that |
Wait, maybe I'm missing something, isn't this entire package supposed to be 3.6+? From
|
Sorry, I think was mixed up by the title. @rgabbard am I right that the issue is not about "Python < 3.6" as the title says, but only for non-CPython 3.6 where dicts are not guaranteed to have deterministic iteration order? |
@ConstantineLignos : Correct - apologies for the incorrect title |
#51 made me notice our current code loses the
ImmutableDict
ordering guarantee on any 3.6 implementations which do not guarantee deterministic dict ordering in general because if we initialize from anIterable
of key-value pairs, we eventualy just pass the iterable directly todict
.My inclination is to crash on module load in the same circumstances we currently crash when trying to initialize from a
dict
. That will prevent inadvertent bugs. If someone needs to run on a non-CPython 3.6 implementation, they can add the alternate implementation which maintains ordering. @ConstantineLignos ?tag @berquist
The text was updated successfully, but these errors were encountered: