3 ms·
There isn't all that much code written for Python 3 to care about backwards compatibility. IMO Python 4 should be: - backwards compatible with the latest relea
by Grue3 11y ago
There isn't all that much code written for Python 3 to care about backwards compatibility. IMO Python 4 should be:
- backwards compatible with the latest release of Python 2
- contain all features of Python 3 in some form
I think this will result in a very speedy adoption.
In the future I propose the following numbering scheme: for any N > M, Python N contains all features of Python M and is backwards compatible with Python M if and only if M divides N.
- ngoldbaum 11y agoThose two statements are mutually incompatible. Python3 is a different language with different semantics. It is possible to work in a subset of python2 and python3 that is syntactically valid under both interpreters but this is not what you are suggesting.
- Grue3 11y agoNo, you are confusing "features" and "syntax". Both Python 2 and Python 3 are Turing complete. They have the same expressiveness. It's possible to backwards-compatibly extend Python 2 to achieve feature-parity with Python 3 while preserving Python 2 syntax. Python 4 proposed by me is possible, while Python 6 (which must be backwards-compatible with both 2 and 3) is probably not possible.
- orf 11y ago> It's possible to backwards-compatibly extend Python 2 to achieve feature-parity with Python 3 while preserving Python 2 syntax. The syntax between 2 and 3 is essentially the same. A few minor tweaks here and there, but nothing major. Your point is a bit pointless because changes to the language that are not on the syntactical level (i.e unicode/bytes) cause the meaning of the code to change, despite the syntax being the same.
- orf 11y ago> IMO Python 4 should be: > - backwards compatible with the latest release of Python 2 > - contain all features of Python 3 in some form I'm lost for words.
- Practicality 11y agoPython 4 should be magic.
- schoen 11y agoMaybe by that time the Python community will have figured out how to make computers (or their owners) fly when you import antigravity!
- Grue3 11y agoPlease elaborate. Which feature of Python 3 would be impossible to implement in Python 2? Note that Python 3 code is not guaranteed to work in Python 4, but you are guaranteed to (relatively) painlessly port it, since all Python 3 features are implemented in Python 4 in some way.
- verbatim 11y agoPick a Python 3 feature and let us know how you would implement it in Python 2.
- Grue3 11y agoEasy. Feature: print function. Implementation: from __future__ import print_function Yes, that magical, backwards-incompatible, print function has been in Python 2 all along! Feature: unicode strings Implementation: from __future__ import unicode_literals Amazing! The magical, backwards-incompatible unicode strings backported to Python 2 with one single line. I could go on and on.
- orf 11y ago> Amazing! The magical, backwards-incompatible unicode strings backported to Python 2 with one single line. Except it's not even slightly close to that is it. unicode_literals is something completely different. How about removing old style classes? Is `class x:` old style or new style in Python 2, in this imaginary interpreter of yours? How about the default object comparison being sane in Python 3. How about the changes to builtins returning iterables over lists? How about the import system being more sane? How about removing backticks? How about actually handling the unicode differences? I could go on and on, and I hope your answer is not 'well we just need more __future__ imports don't we'.
- takeda 11y agoThis is just getting tiring. Please just switch to some other language so you and everyone else will be happy.
- s73v3r 11y agoOr just update to Python 3. It's honestly not that hard.