Re: set/dict comp in Py2.6

2008-10-29 Thread Benjamin
On Oct 27, 3:38 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 25 Oct 2008 23:44:46 -0200, Benjamin <[EMAIL PROTECTED]>   > escribió: > > > On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: > >> I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > >> dicts of Python 3.

Re: set/dict comp in Py2.6

2008-10-27 Thread Gabriel Genellina
En Sat, 25 Oct 2008 23:44:46 -0200, Benjamin <[EMAIL PROTECTED]> escribió: On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: I'd like to know why Python 2.6 doesn't have the syntax to create sets/ dicts of Python 3.0, like: Because nobody bothered to backport them. En Sat, 25 Oct 2008 23:47:32

Re: set/dict comp in Py2.6

2008-10-26 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: Because nobody bothered to backport it. > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} > > Bye, > bearophile -- http://mail.python.org/m

Re: set/dict comp in Py2.6

2008-10-26 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: Because nobody bothered to backport it. > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} > > Bye, > bearophile -- http://mail.python.org/m

Re: set/dict comp in Py2.6

2008-10-25 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: Because nobody bothered to backport them. > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} > > Bye, > bearophile -- http://mail.python.or

Re: set/dict comp in Py2.6

2008-10-25 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: Because nobody bothered to backport them. > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} > > Bye, > bearophile -- http://mail.python.org

Re: set/dict comp in Py2.6

2008-10-25 Thread bearophileHUGS
Sorry for the answering delay, Google Groups is slow today. Steven D'Aprano: >Personally, I don't see the advantage of set and dict comprehensions. I think >the value of them is very marginal, not worth the additional syntax.< If it's worth in 3.0 then it's worth in 2.6 too. If it isn't worth i

Re: set/dict comp in Py2.6

2008-10-25 Thread Paul Rubin
[EMAIL PROTECTED] writes: > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} I've always just used: set(x*x for x in xrange(10)) dict((x,x*x) for x in xrange(10)) I didn't even realize that you could write sets with {...}. -- http://mail.python.org/mailman/listinfo/python-list

Re: set/dict comp in Py2.6

2008-10-25 Thread Lie Ryan
On Sat, 25 Oct 2008 09:07:35 +, Steven D'Aprano wrote: > On Sat, 25 Oct 2008 01:13:08 -0700, bearophileHUGS wrote: > >> I'd like to know why Python 2.6 doesn't have the syntax to create sets/ >> dicts of Python 3.0, like: >> >> {x*x for x in xrange(10)} >> {x:x*x for x in xrange(10)} > > Ma

Re: set/dict comp in Py2.6

2008-10-25 Thread Steven D'Aprano
On Sat, 25 Oct 2008 01:13:08 -0700, bearophileHUGS wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} Maybe nobody asked for it? Personally, I don't see the advantage of set an