From b9cf35b82a5b5dd74934244368642b50c24672e6 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 12 Oct 2007 20:25:27 +0000 Subject: [PATCH] Clarify backwards compatibility. --- pep-3105.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pep-3105.txt b/pep-3105.txt index b10ad1391..0057f52dd 100644 --- a/pep-3105.txt +++ b/pep-3105.txt @@ -93,9 +93,23 @@ Backwards Compatibility ======================= 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 -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 and replaced reliably and non-ambiguously by an automated tool, so