Implicit lists
Alex Martelli
aleax at aleax.it
Thu Jan 30 16:04:51 EST 2003
Dale Strickland-Clark wrote:
> Alex Martelli <aleax at aleax.it> wrote:
>
>>It says that strings are to be treated as a list of 1. Not sure what
>>you mean by "excluded". The OP also gave an example that did
>>not meet his own specs (he went out of his way to treat _tuples_
>>NOT as lists of one item).
>>
>
> Sorry. I was using the term 'list' in it's general sense, rather than
> the Python definition. In other words, anything that is normally
> represented by items seperated by commas. So Python lists and tuples
> are in, str and unicode (and anything else normally represented by an
> unbroken string of characters) are out.
>
> I'm sure even that definition has holes but maybe it's clearer.
Actually quite clear, but finding holes is more fun:-).
A dictionary, {1:2, 3:4, 5:6}, is a list of items separated
by commas (the items are (1,2), (3,4), ...) -- how do you
want to treat it?
Alex
More information about the Python-list
mailing list