Reasonable people can differ here, but I agree that if what you care
about is a side effect, rather than a resulting list, using a for loop
is more clear than a list comprehension.  (I suspect it is also more
performant since you are not allocating and populating a list object
for no reason.)

But in this case I think it's clear that the best way is to simply write

t.extend(data)


On 1/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> there are several places of such unused lists being made.
>
> i pick a random occurence, in this case InstrumentedAttribute:
>
>     def _adapt_list(self, data):
>         if self.typecallable is not None:
>             t = self.typecallable()
>             if data is not None:
>                 [t.append(x) for x in data]
>             return t
>         else:
>             return data
>
> why not just
>     for x in data: t.append(x)
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to