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 and dict comprehensions. I think the value of them is very marginal, not worth the additional syntax. set([x*x for x in xrange(10)]) dict((x, x*x) for x in xrange(10)) work perfectly well using the existing syntax. -- Steven -- http://mail.python.org/mailman/listinfo/python-list