[Python-3000] Detecting conflicts in dict displays

Guido van Rossum guido at python.org
Tue Jul 11 06:43:04 CEST 2006


Currently, this is valid:

  a = {'a': 1, 'a': 2}
  print a     # {'a': 2}

I wonder if we shouldn't make this a run-time error instead. If people
agree, what should we do with

  a = {'a': 1, 'a': 1}

??? In ABC, that's legal (and the first one is indeed an error; I took
a shortcut when I decided not to test for that in Python).

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list