Time we switched to unicode? (was Explanation of this Python language feature?)

Terry Reedy tjreedy at udel.edu
Tue Mar 25 20:24:26 EDT 2014


On 3/25/2014 8:07 AM, Antoon Pardon wrote:
> On 25-03-14 12:12, Chris Angelico wrote:
>
>> On Tue, Mar 25, 2014 at 9:24 PM, Antoon Pardon
>> <antoon.pardon at rece.vub.ac.be> wrote:
>>> No they didn't have to. With the transition to python3, the developers
>>> could have opted for empty braces to mean an empty set. And if they
>>> wanted a literal for an empty dictionary, they might have chosen {:}.
>>> Backward-compatibility was already broken so that wasn't an argument.
>> Python 3.0 didn't just say "to Hades with backward compatibility". The
>> breakage was only in places where it was deemed worthwhile. Changing
>> the meaning of {} would have only small benefit and would potentially
>> break a LOT of programs, so the devs were right to not do it.
>
> More programs than those who broke because print was now a function?

It is quite possible that the print change broke more than the dict 
change would have. The difference is that the print statement syntax was 
both awful and limited. The print function uses standard syntax and is 
more flexible.

The fact that print could be turned into a function shows that it did 
not need to be a statement. All other simple statements except 'pass' 
either implicitly quote an expression in the statement, jump control, or 
declare something to the compiler.

The other fact that Chris noted, that '{}' would have been valid but 
with different meanings in Py1/2 versus Py3, was a factor on the cost 
side. We generally try to avoid such ambiguities.

Except for this last point, I was in favor of the switch.

-- 
Terry Jan Reedy





More information about the Python-list mailing list