On Sat, 22 Nov 2008 22:58:48 +0100, spir wrote:
> W W a écrit :
> > On Sat, Nov 22, 2008 at 9:42 AM, spir <[EMAIL PROTECTED]> wrote:
> >
> >> I have long thought "[]" /simply/ is a list constructor syntax. What
> >> do you think of the following?
> >>
> >> t = "aze"
> >> print t, list(t), [
On Sat, Nov 22, 2008 at 10:42 AM, spir <[EMAIL PROTECTED]> wrote:
> I have long thought "[]" /simply/ is a list constructor syntax.
list(x) and [x] are not equivalent, as you have discovered. list(x)
requires that x is a sequence - something that can be iterated - and
it makes a new list out of t
W W a écrit :
> On Sat, Nov 22, 2008 at 9:42 AM, spir <[EMAIL PROTECTED]> wrote:
>
>> I have long thought "[]" /simply/ is a list constructor syntax.
>> What do you think of the following?
>>
>> t = "aze"
>> print t, list(t), [t]
>> print list(list(t)), list([t]), [list(t)], [[t]]
>> ==>
>> aze ['
On Sat, Nov 22, 2008 at 9:42 AM, spir <[EMAIL PROTECTED]> wrote:
> I have long thought "[]" /simply/ is a list constructor syntax.
> What do you think of the following?
>
> t = "aze"
> print t, list(t), [t]
> print list(list(t)), list([t]), [list(t)], [[t]]
> ==>
> aze ['a', 'z', 'e'] ['aze']
> ['
I have long thought "[]" /simply/ is a list constructor syntax.
What do you think of the following?
t = "aze"
print t, list(t), [t]
print list(list(t)), list([t]), [list(t)], [[t]]
==>
aze ['a', 'z', 'e'] ['aze']
['a', 'z', 'e'] ['aze'] [['a', 'z', 'e']] [['aze']]