[Python-ideas] syntax for set

Terry Reedy tjreedy at udel.edu
Mon Nov 15 22:57:23 CET 2010


On 11/15/2010 2:02 PM, Guido van Rossum wrote:
> There is nothing obvious about {:} for the empty dictionary. :-)

'Obvious' is always relative to the beholder ;-).

Let me try again:
If I were designing a new language and had already decided on
{}, {1}, {1,2} ... for set displays and
??, {1:'one'} ... for dict displays and
on the corresponding comprehension forms as in Python,
then one 'obvious' choice *to me' for ?? would be '{:}'.
Substitute any other shifted char, preferably typed by the right hand, 
if you want.

However, the hypothetical de novo choice of something other than '{}' 
for ?? is irrelevant to the fact the Python 3 was not a new language and 
that changing the meaning of a syntactic constant like '{}' would have 
caused problems. I am more appreciative of that after seeing the 
problems people have had the the shift of meaning for unprefixed string 
constants.

-- 
Terry Jan Reedy




More information about the Python-ideas mailing list