[Python-porting] Control of hash randomization
martin at v.loewis.de
martin at v.loewis.de
Sun May 27 10:24:19 CEST 2012
More information about the Python-porting mailing list
Sun May 27 10:24:19 CEST 2012
- Previous message: [Python-porting] Control of hash randomization
- Next message: [Python-porting] Control of hash randomization
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> That issue is pretty subtle. The more common case is iterating > through a set or dict (or a tuple that was sorted by hash, which is > the most common case for SymPy), and there is some subtle fact about > the loop that makes the result differ depending on the result of > iteration. Quite often, the result is still "correct" (in SymPy, this > generally means the answer is still mathematically correct), just not > the same as what the test expected. But there are standard procedures to deal with that very phenomenon: use a proper equality function. People have written tests for years that somehow relied on the order of keys in a dictionary (an issue in particular for doctest). If you find a failed assertion, and it involves an equality test, verify that the comparison uses "normalized" representations of the value. If not, add the normalization to all related test cases. Regards, Martin
- Previous message: [Python-porting] Control of hash randomization
- Next message: [Python-porting] Control of hash randomization
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-porting mailing list