Earlier quoted context omitted.
If 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-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.
personally, i just drop a f-string in setup.py and that'll filter out any python for which this issue pertains.
Python dicts are now ordered
211–220 of 457 posts
Re: Python dicts are now ordered
#212Earlier quoted context omitted.
My main issue with it is that if someone figures out an even better way to do dictionaries but it doesn't preserve insertion order, then that technique can't be used. But I certainly wouldn't call it a stupid decision, the problem is that once a behaviour is observable then people absolutely will start relying on it.
All they have to do is give it a different name, such as unordered_dict.
Re: Python dicts are now ordered
#213This is an amazing contribution to the language. A mixture of speed and convenience, probably made by volunteers. As for people criticizing a change to what use to be a non-deterministic ordering of a dict iteration; I don't know what to say to them, other than, are you serious? There are people out there who are working for us, they work for free and they did some heavy lifting to give us this. They might read what…
People who bother to complain are those who actually care about your thing. People who do not care simply leave without ever telling you why. Your complainers are often your most dedicated and invested users.
Python is just bizarrely political. I suspect that it's now cursed for all time to have every future PEP become a battle in a proxy war over PEP 3000.
Re: Python dicts are now ordered
#214I think this change is great, but this really only becomes news again once all major LTS are shipping with at least Python 3.7, right? No one can really use it in code they plan to distribute at the moment. Maybe I am underestimating the amount of Python code that is meant for internal or personal use only.
Re: Python dicts are now ordered
#215Earlier quoted context omitted.
All they have to do is give it a different name, such as unordered_dict.
Which means no one gets it for free when it is added to the language.
Re: Python dicts are now ordered
#216Earlier quoted context omitted.
Other languages don't generally have special order guarantees about standard maps. This seems very idiosyncratic.
std::map in C++ stores keys in order. You have to use std::unordered_map to not get that behavior.
Re: Python dicts are now ordered
#2172) This will make life easier for thousands of programmers and prevent a massive number of extremely difficult bugs from hurting users.
Re: Python dicts are now ordered
#218It seems people dont realize that you can have your cake and eat it too. You can have both orderered and unordered maps in the same language: https://yaml.org/type/map https://yaml.org/type/omap No reason to argue about which one to make "dict". In fact it would be better to have both because youre taking a performance hit (a significant one) by ordering the entries.
Re: Python dicts are now ordered
#219Earlier quoted context omitted.
As it’s widely known, more often than not “criticism” of open source software quickly devolves into hate and toxicity. Helpful criticism is great but be careful with defending the “criticism culture” around foss, it’s often angry unhappy people that want it all for free on a golden platter, and yesterday.
That does not matter, nothing is above criticism.
Re: Python dicts are now ordered
#220This is an amazing contribution to the language. A mixture of speed and convenience, probably made by volunteers. As for people criticizing a change to what use to be a non-deterministic ordering of a dict iteration; I don't know what to say to them, other than, are you serious? There are people out there who are working for us, they work for free and they did some heavy lifting to give us this. They might read what…
Other languages don't generally have special order guarantees about standard maps. This seems very idiosyncratic.