Clarify backwards compatibility.
This commit is contained in:
parent
7ecd06cd4d
commit
b9cf35b82a
18
pep-3105.txt
18
pep-3105.txt
|
@ -93,9 +93,23 @@ Backwards Compatibility
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
The changes proposed in this PEP will render most of today's ``print``
|
The changes proposed in this PEP will render most of today's ``print``
|
||||||
statements invalid, only those which incidentally feature parentheses
|
statements invalid. Only those which incidentally feature parentheses
|
||||||
around all of their arguments will continue to be valid Python syntax
|
around all of their arguments will continue to be valid Python syntax
|
||||||
in version 3.0.
|
in version 3.0, and of those, only the ones printing a single
|
||||||
|
parenthesized value will continue to do the same thing. For example,
|
||||||
|
in 2.x::
|
||||||
|
|
||||||
|
>>> print ("Hello")
|
||||||
|
Hello
|
||||||
|
>>> print ("Hello", "world")
|
||||||
|
('Hello', 'world')
|
||||||
|
|
||||||
|
whereas in 3.0::
|
||||||
|
|
||||||
|
>>> print ("Hello")
|
||||||
|
Hello
|
||||||
|
>>> print ("Hello", "world")
|
||||||
|
Hello world
|
||||||
|
|
||||||
Luckily, as it is a statement in Python 2, ``print`` can be detected
|
Luckily, as it is a statement in Python 2, ``print`` can be detected
|
||||||
and replaced reliably and non-ambiguously by an automated tool, so
|
and replaced reliably and non-ambiguously by an automated tool, so
|
||||||
|
|
Loading…
Reference in New Issue