S
Steven Bethard
Tom Anderson said:> Sounds good. More generally, i'd be more than happy to get rid of list
> comprehensions, letting people use list(genexp) instead. That would
> obviously be a Py3k thing, though.
Alex said:> I fully agree, but the BDFL has already (tentatively, I hope)
> Pronounced that the [...] form will stay in Py3K as syntax sugar for
> list(...). I find that to be a truly hateful prospect, but that's the
> prospect:-(.
Steven said:> I'm not sure I find it truly hateful, but definitely unnecessary.
> TOOWTDI and all...
Paul said:> Well, [...] notation for regular lists (as opposed to list
> comprehensions) is also unnecessary since we could use
> "list((a,b,c))".
I'm not sure that's really a fair comparison. Do you really find:
list(x**2 for x in iterable)
harder to read than:
[x**2 for x in iterable]
?? I don't, though perhaps this is just me. OTOH, I do find:
list((a, b, c))
to be substantially harder to read than:
[a, b, c]
due to the nested parentheses. Note that replacing list comprehensions
with list(...) doesn't introduce any nested parentheses; it basically
just replaces brackets with parentheses.
Just in case there was any confusion, I definitely wasn't suggesting
that we remove list literal support.
STeVe