3 ms·
CPython interates in this fashion since 3.6, but it is not part of the Python spec. Might be a bit contentious but it's not supposed to be relied upon
by rtpg 9y ago
CPython interates in this fashion since 3.6, but it is not part of the Python spec.
Might be a bit contentious but it's not supposed to be relied upon
- thijsvandien 9y agoIt was recently decided that as of 3.7 it will be. (Source: https://mail.python.org/pipermail/python-dev/2017-December/151283.html https://mail.python.org/pipermail/python-dev/2017-December/1...)
- dbcurtis 9y agoHmmmmmm.... that makes it hard for other implementations. CPython isn't the whole of the Python world. Requirements like that can be problematic for implementations like Micropython, for instance.
- jsmeaton 9y agoThe entire reason they decided to make it a standard rather than keep it as an implementation detail is to make things better for users. It’s not about just looking after cpython.
- sametmax 9y agoThey asked people from the Jython, pypy and uPython community if it was ok before doing so.
- lozenge 9y agoI suspect the reasoning was with CPython dominating, people would eventually make this assumption in their code, perhaps unintentionally, and reduce compatibility. Better to make it official.
- crdoconnor 9y agoThe headache that having non-deterministic code causes more than makes up for that. Among other things this makes writing tests much easier.