Raymond Hettinger wrote:

> Thomas Wouters wrote:
>
>>
>>
>> On 7/11/06, *Guido van Rossum* <[EMAIL PROTECTED] 
>> <mailto:[EMAIL PROTECTED]>> wrote:
>>
>>     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.
>>
>>
>> Maybe. Like that, sure. But what about:
>>
>>  a = {a: 1, b: 2}
>>
>> where 'a' and 'b' happen to be equal (or equal enough for dicts)? I'd 
>> rather leave this kind of checking up to pycheker or pylint (which 
>> already check for quite a lot more than I'd want the Python runtime 
>> to check :)
>
> +1 for leaving this to PyLint or PyChecker.

Wouldn't the behavior of the above be undefined for the case where a == 
b?  I'd much rather get an exception than undefined behavior.

Cheers,

-- 
--------------------------------------------------------------------
Aaron Bingham
Senior Software Engineer
Cenix BioScience GmbH
--------------------------------------------------------------------

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to