Re: [Python-3000] Detecting conflicts in dict displays

2006-07-13 Thread Aaron Bingham
Raymond Hettinger wrote: > Thomas Wouters wrote: > >> >> >> On 7/11/06, *Guido van Rossum* <[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 r

Re: [Python-3000] set literals

2006-07-13 Thread Fredrik Lundh
Raymond Hettinger wrote: > I'm curious as to whether people will find one-type-with-two-purposes > easier to learn that what we have now. we haven't had that for long, and I cannot recall anyone being puzzled by the fact that you can use a dictionary of (item, None) pairs to efficiently represen

Re: [Python-3000] set literals

2006-07-13 Thread Fredrik Lundh
Greg Ewing wrote: >> I say nuke it. Who needs it? > > There are algorithms which effectively involve a > mapping keyed by a set. E.g. converting an NFA > to a DFA requires building up sets of states from > the NFA and associating each one with a state in > the DFA. > > You can kludge around it, bu

Re: [Python-3000] set literals

2006-07-13 Thread Fredrik Lundh
> we haven't had that for long, and I cannot recall anyone being puzzled by the > fact that you can use a dictionary of (item, None) pairs to efficiently > represent > a set. message += " before set was added to the language" ___ Python-3000 maili

Re: [Python-3000] Detecting conflicts in dict displays

2006-07-13 Thread Guido van Rossum
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 (whic

Re: [Python-3000] Detecting conflicts in dict displays

2006-07-13 Thread Fredrik Lundh
Guido van Rossum wrote: >> 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]

Re: [Python-3000] Removing functions from the operator module

2006-07-13 Thread Collin Winter
On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > On 7/3/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > It turns out I was misled by Collin's claim that the PEP wants > > isCallable and sequenceIncludes removed "because there are better, > > more obvious ways to spell these things." He mus