4 ms·
The trouble is I publish a (new) code that advertises itself as working on 3.x and then it turns out it is being used by a person who only had the version prior
by harikb 7y ago
The trouble is I publish a (new) code that advertises itself as working on 3.x and then it turns out it is being used by a person who only had the version prior to this change.
That said, Go made a similar change (from insertion-order to explicitly-randomized) and world didn’t end. So there’s that.
- ryebit 7y agoIf your code relies on a minimum python version, you can add `python_requires=">=3.5"` to your setup.py [https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires https://packaging.python.org/guides/distributing-packages-us...] to ensure it's not installed on older releases. That field itself is kinda new; but if needing to block users with older versions, that shouldn't be an issue.
- hprotagonist 7y agopersonally, i just drop a f-string in setup.py and that'll filter out any python for which this issue pertains.
- baq 7y agoThis might not work if you’re distributing a wheel.
- AdamN 7y agoPython 3.4 is EOL anyway so there's no need to do this. Anybody running 3.4 is already unsupported.
- hprotagonist 7y agoand 3.5 dies in september. hurray!
- throwaway894345 7y agoFWIW, when Go made that change, it was a much less-widely-used language (smaller blast radius).
- strken 7y agoI thought Go made the change from undefined behaviour with an underlying implementation that was insertion order in a map with 8 or fewer entries, to similarly undefined behaviour with an implementation that randomised lookups in those cases. Any code that has ever relied on any kind of ordering in Go maps will almost certainly be wrong, even random ordering, because the distribution of the "random" ordering is biased. See https://medium.com/i0exception/map-iteration-in-go-275abb76f721 https://medium.com/i0exception/map-iteration-in-go-275abb76f...