Re: [Python-3000] Set literal

2008-01-30 Thread Greg Ewing
Nicko van Someren wrote: > Personally I'd like set comprehensions to give me mutable > sets, and so I feel set literals should do the same. Do you really want set comprehensions at all, given that set(genexp) exists? -- Greg ___ Python-3000 mailing li

Re: [Python-3000] Set literal

2008-01-30 Thread Greg Ewing
Mike Klaas wrote: > over 120k loc: > > All uses of set(): > > $ pygrep '[^.a-z]set[(]' | grep -v unittest | wc > 3201583 24774 > > Empty set(): > > $ pygrep '[^.a-z]set[(][)]' | grep -v unittest | wc > 114 4787406 But that doesn't count uses of tuples that could be tur

Re: [Python-3000] Set literal

2008-01-30 Thread Thomas Wouters
On Jan 30, 2008 3:17 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Nicko van Someren wrote: > > Personally I'd like set comprehensions to give me mutable > > sets, and so I feel set literals should do the same. > > Do you really want set comprehensions at all, given that > set(genexp) exists? > Too

Re: [Python-3000] Set literal

2008-01-30 Thread Christian Heimes
Greg Ewing wrote: > Do you really want set comprehensions at all, given that > set(genexp) exists? For me comprehension are a means to optimize common patterns in the sense of faster to execute, faster to read and faster to write. Do set comprehensions occur so often that {item for item in sequenc

Re: [Python-3000] Set literal

2008-01-30 Thread Greg Ewing
Thomas Wouters wrote: > > On Jan 30, 2008 3:17 PM, Greg Ewing <[EMAIL PROTECTED] > > wrote: > > Do you really want set comprehensions at all, given that > set(genexp) exists? > > Too late. I thought Guido said it wasn't too late to change this? -- Greg _

Re: [Python-3000] Set literal

2008-01-30 Thread Guido van Rossum
On Jan 30, 2008 4:01 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Thomas Wouters wrote: > > > > On Jan 30, 2008 3:17 PM, Greg Ewing <[EMAIL PROTECTED] > > > wrote: > > > > Do you really want set comprehensions at all, given that > > set(genexp) exists? > > > > Too l

Re: [Python-3000] Set literal

2008-01-30 Thread Terry Reedy
"Christian Heimes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Greg Ewing wrote: | | Personally I'm more than happy to trade set comprehensions for optimized | frozen set literals. My code has more 'item in fixed_set' than sets. I | can't remember a project where I've used froz