4 ms·
Just a example for a breaking change between Python 3.7 and before: https://stackoverflow.com/q/51196568/6885801 https://stackoverflow.com/q/51196568/6885801 I
by maple3142 6y ago
Just a example for a breaking change between Python 3.7 and before: https://stackoverflow.com/q/51196568/6885801 https://stackoverflow.com/q/51196568/6885801
It is because Python 3.7 makes "async" a reserved word, which was a valid identifier name before.
- oefrha 6y agopy34 asyncio was provisional (read: experimental, API in flux). It was very clearly labeled as such in both py34 and py35.[1][2] In py36 it was no longer provisional, but async/await syntax was established in py35 and asyncio.async was already deprecated back then. Using an example of a clearly experimental and evolving feature as breaking backwards-compatibility is disingenuous. Now, there are actual backwards-incompatible changes that aren't made after at least two versions of deprecation, but those tend to be low level and subtle. [1] https://docs.python.org/3.4/library/asyncio.html https://docs.python.org/3.4/library/asyncio.html [2] https://docs.python.org/3.5/library/asyncio.html https://docs.python.org/3.5/library/asyncio.html More on provisional API: https://docs.python.org/3.8/glossary.html#term-provisional-api https://docs.python.org/3.8/glossary.html#term-provisional-a... > A provisional API is one which has been deliberately excluded from the standard library’s backwards compatibility guarantees. While major changes to such interfaces are not expected, as long as they are marked provisional, backwards incompatible changes (up to and including removal of the interface) may occur if deemed necessary by core developers. Such changes will not be made gratuitously – they will occur only if serious fundamental flaws are uncovered that were missed prior to the inclusion of the API.
- Xixi 6y agoI think you misunderstood maple3142 comment: he is only saying that from Python 3.7 onward you could not use "async" as an identifier in your code, as it became a reserved word. So maybe you were using "async" as a variable name, or as a function name in your code, and suddenly that wouldn't work anymore. It definitely is a backwards-incompatible change, and that has nothing to do with provisional APIs. Since I have never use "async" as an identifier in my own code, I have no idea if warnings were issued, though probably?
- oefrha 6y agoReserved words are introduced into languages over time. This is how languages evolve and hardly Python-specific. (Example: Rust added async/await keywords relatively recently.) You either stick with an old version or deal with it. gp specifically links to a SO question discussing asyncio.async breakage, which would be considered API breaking except it was specifically provisional.