Re:PEP 492 – Coroutines with async and await syntax
by orf on Saturday April 18, 2015 @09:15AM
(#9399338)
It's unlikely that print statements are the only thing that won't work in older Python 2 code, the standard lib has changed (for the better) and there are lots of other smaller changes that could stop a script from running.
[ Parent
| on HN ]
Re:PEP 492 – Coroutines with async and await syntax
by captainmuon on Saturday April 18, 2015 @09:40AM
(#9399419)
Sure, that's why I say it's in part psychological. It feels like that change was made just to spite users. "It's my language and I can do what I want." Of course, that's nonsense. Still, I believe that adding back a print statement would make the transition easier for some people.
For the people that are stuck with Python 2 legacy code, we'd need something else.
Python-future [1] seems to be able to import some Python 2 modules, but I'm not sure how far it goes.
Re:PEP 492 – Coroutines with async and await syntax
by actsasbuffoon on Saturday April 18, 2015 @10:15AM
(#9399507)
Making print a statement again would mean you can't print in a lambda. That'll break a bunch of Python 3 code, which puts us right back where we started; people being upset about a new release of Python breaking their code.
Re:PEP 492 – Coroutines with async and await syntax
by alextgordon on Saturday April 18, 2015 @02:42PM
(#9400538)
You don't need to jettison print-as-a-function in order to have print-as-a-statement.
>>> print "hello"
SyntaxError: Missing parentheses in call to 'print'
If it can print a SyntaxError explaining the problem then it can print "hello".The only snag is that a tuple would be printed slightly differently, but that is harmless.
People should be upset that a new release of Python breaks their code, because the Python developers acted unprofessionally in expecting all python code in existence to be rewritten to suit their aesthetic fetishes.
Re:PEP 492 – Coroutines with async and await syntax
by scrollaway on Saturday April 18, 2015 @06:31PM
(#9401346)
So instead of code breaking explicitly, you'd rather it breaks implicitly?
You're really foolish if you believe that's better. The print keyword isn't what is preventing 3k adoption.