[Python-ideas] ('blue', 'red', 'orange' if something, 'green')

cool-RR cool-rr at cool-rr.com
Fri Apr 22 12:57:12 CEST 2011


On Fri, Apr 22, 2011 at 12:52 PM, Andre Engels <andreengels at gmail.com>wrote:

> On Fri, Apr 22, 2011 at 12:48 PM, cool-RR <cool-rr at cool-rr.com> wrote:
>
> > I see. It's about as elegant as the other suggestions. And it's pretty
> > annoying to use a list when I really wanted to use a tuple. Yeah, I can
> > convert it to a tuple at the end, but that's just making it more verbose.
>
> But why do you want to have a tuple? A list is the logical Python
> translation of this kind of semantics.
> --
> André Engels, andreengels at gmail.com
>
>
"This kind of semantics"? What semantics did we have here except filtering
items before putting them in the sequence? How is that more list-y than
tuple-y? If I removed items *after* constructing the sequence, it'd be
list-y, but since I want to do it *before* the construction, I think it
doesn't make it list-y.

I used a tuple in this case because it's something that I wanted to stay
immutable.


Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110422/59cd1320/attachment.html>


More information about the Python-ideas mailing list