News for hackers. Stuff that matters.
Re:Code that will break in Python 4 by Grue3 on Tuesday January 12, 2016 @11:47AM (#10888441)
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.

Re:Code that will break in Python 4 by orf on Tuesday January 12, 2016 @12:13PM (#10888669)
> 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.

Re:Code that will break in Python 4 by Grue3 on Tuesday January 12, 2016 @02:47PM (#10889828)
Please 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.
Re:Code that will break in Python 4 by takeda on Tuesday January 12, 2016 @03:40PM (#10890198)
Python is Turing Complete, so everything you can do in Py3 you can do in Py2, but so you can also implement in Brainfuck.

The question is whether programming in one version vs the other is more enjoyable.

Re:Code that will break in Python 4 by verbatim on Tuesday January 12, 2016 @03:12PM (#10890000)
Pick a Python 3 feature and let us know how you would implement it in Python 2.
Re:Code that will break in Python 4 by Grue3 on Tuesday January 12, 2016 @04:52PM (#10890703)
Easy.

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.

Re:Code that will break in Python 4 by orf on Tuesday January 12, 2016 @06:05PM (#10891113)
> 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'.

Re:Code that will break in Python 4 by Practicality on Tuesday January 12, 2016 @12:32PM (#10888819)
Python 4 should be magic.
Re:Code that will break in Python 4 by schoen on Tuesday January 12, 2016 @01:59PM (#10889526)
Maybe by that time the Python community will have figured out how to make computers (or their owners) fly when you import antigravity!
Re:Code that will break in Python 4 by ngoldbaum on Tuesday January 12, 2016 @12:13PM (#10888662)
Those 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.

Re:Code that will break in Python 4 by Grue3 on Tuesday January 12, 2016 @02:43PM (#10889799)
No, 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.
Re:Code that will break in Python 4 by orf on Tuesday January 12, 2016 @03:39PM (#10890184)
> 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.

Re:Code that will break in Python 4 by s73v3r on Tuesday January 12, 2016 @12:43PM (#10888902)
Or just update to Python 3. It's honestly not that hard.
Re:Code that will break in Python 4 by takeda on Tuesday January 12, 2016 @12:20PM (#10888728)
This is just getting tiring. Please just switch to some other language so you and everyone else will be happy.