On 7/13/06, Aaron Bingham <[EMAIL PROTECTED]> wrote:
[Quoting someone else]
> >> 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.

There's nothing undefined in the language currently about {a: 1, b:
2}. It creates an empty dict d, and then does d[a] = 1; d[b] = 2. If a
and b are equal, you end up with {a: 2}.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
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