4 ms·
> With the release of Python 3.6, it became clear that Pylama was in need of maintenance updates. Python 3.6 warned that async was about to become a reserved ke
by foo101 8y ago
> With the release of Python 3.6, it became clear that Pylama was in need of maintenance updates. Python 3.6 warned that async was about to become a reserved keyword in Python 3.7.
I can imagine there must be lot of code bases with async as variable name. For example:
async = True
This is an error in Python 3.7.
>>> async = 1
File "<stdin>", line 1
async = 1
^
SyntaxError: invalid syntax
But this used to run just fine without any warning or issues until Python 3.5.
So now any code that uses async as a variable name would break. So is Python 3.7 considered a breaking change that is not backward compatible?
- mcintyre1994 8y agoYep, Python doesn't use semver and after 2-3 I doubt they're keen on major version changes any more. From the 3.7 release notes (https://docs.python.org/3/whatsnew/3.7.html https://docs.python.org/3/whatsnew/3.7.html): Backwards incompatible syntax changes: async and await are now reserved keywords.
- foo101 8y agoHas any other mainstream programming language like C or Java introduced such reserved keywords in a new release? I guess if C or Java were to do something like this it would cause a lot of hue and cry. I remember when C++ had to introduce a keyword for automatic type inference they reused the 'auto' keyword instead of introducing a new keyword at the risk of breaking a lot of existing code. How do other mainstream languages handle a scenario like this where a new keyword is required?
- floatboth 8y agoC/C++ compilers support multiple versions of the standards at the same time. You can compile one file with -std=c++98 and another with -std=c++17 and link them together just fine. Rust is now doing the same thing with editions. Perl has 'use VERSION', but I'm not very familiar with it, not sure if e.g. new keywords only become available with that statement. The docs say 'use VERSION also lexically enables all features available in the requested version…'
- pas 8y agoenum, assert was added to Java, but nothing major since then. (var is an invalid class name starting in Java 10, and underscore is a keyword since Java 9) https://en.wikipedia.org/wiki/List_of_Java_keywords https://en.wikipedia.org/wiki/List_of_Java_keywords For C++ ( New keywords: alignas, alignof, char16_t, char32_t, constexpr, decltype, noexcept, nullptr, static_assert, and thread_local ) : https://stackoverflow.com/questions/6399615/what-breaking-changes-are-introduced-in-c11 https://stackoverflow.com/questions/6399615/what-breaking-ch...
- xyrouter 8y agoI did a quick Google search and indeed there are so many examples of such code: https://www.google.com/search?q=site%3Agithub.com+filetype%3Apy+%22async+%3D+True%22 https://www.google.com/search?q=site%3Agithub.com+filetype%3... https://www.google.com/search?q=site%3Agithub.com+filetype%3Apy+%22async+%3D+False%22 https://www.google.com/search?q=site%3Agithub.com+filetype%3... https://www.google.com/search?q=site%3Agithub.com+filetype%3Apy+%22async+%3D+1%22 https://www.google.com/search?q=site%3Agithub.com+filetype%3... https://www.google.com/search?q=site%3Agithub.com+filetype%3Apy+%22async+%3D+0%22 https://www.google.com/search?q=site%3Agithub.com+filetype%3...
- EmmEff 8y agoMy biggest hangup for my project is Celery... not compatible with 3.7 due to the use of the reserved keyboard `async` :(
- MightySCollins 8y agoI just can't stand Celery as a project. It takes ages to stay up to date and I have had a few issues with it which just should not happen for such a large project