jwaixs schrieb:
> Diez B. Roggisch wrote:
>> Why do you wrap a in a list? Just
>>
>> c = a + [b]
>>
>> will do it.
>
> Yes I know, but the problem is I don't know if 'a' is a list or not. I
> could make a type check, but I don't want to program in that way.
So you're telling us that
if not isinstance(a, list):
a = [a]
c = a + [b]
is for some reason not desireable, whereas a much more complex (and most
probably utilizing the very same typechecks) flattening is ok for you?
Not a to convincing argument to me.
Diez
--
http://mail.python.org/mailman/listinfo/python-list