On Mar 19, 4:56 am, Duncan Booth <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I am puzzled by the failure on 'a in a' for a=[a]. >>> a== [a] also
> > fails. Can we assume/surmise/deduce/infer it's intentional?
>
> It may be less confusing if instead of an assignment following by a te
[EMAIL PROTECTED] wrote:
> I am puzzled by the failure on 'a in a' for a=[a]. >>> a== [a] also
> fails. Can we assume/surmise/deduce/infer it's intentional?
>
It may be less confusing if instead of an assignment following by a test
you just consider doing the test at the same time as the assig
> >> >>> b in b
> >> False
>
> > That's actually interesting.
>
> Just for the avoidance of doubt, I didn't write the 'b in b' line:
> castironpi is replying to himself without attribution.
>
> P.S. I still don't see the relevance of any of castironpi's followup to my
> post, but since none it made
On Mar 18, 5:34 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> >> > > On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]>
> >> > > wrote:
>
> >> > >> A common explanation for this is that lists are for homogenous
> >> > >> collections, tuples are for when you have heterog
[EMAIL PROTECTED] wrote:
>> > > On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]>
>> > > wrote:
>>
>> > >> A common explanation for this is that lists are for homogenous
>> > >> collections, tuples are for when you have heterogenous
>> > >> collections i.e. related but different things.
>>
>>
> > > On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
>
> > >> A common explanation for this is that lists are for homogenous
> > >> collections, tuples are for when you have heterogenous collections i.e.
> > >> related but different things.
>
> > > I interpret this as meaning that in a
On Mar 17, 11:03 am, Duncan Booth <[EMAIL PROTECTED]>
wrote:
> Ninereeds <[EMAIL PROTECTED]> wrote:
> > On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
>
> >> A common explanation for this is that lists are for homogenous
> >> collections, tuples are for when you have heterogenous colle
Ninereeds <[EMAIL PROTECTED]> wrote:
> On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
>
>> A common explanation for this is that lists are for homogenous
>> collections, tuples are for when you have heterogenous collections i.e.
>> related but different things.
>
> I interpret this
On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
> A common explanation for this is that lists are for homogenous
> collections, tuples are for when you have heterogenous collections i.e.
> related but different things.
I interpret this as meaning that in a data table, I should have a
[EMAIL PROTECTED] wrote:
> On Mar 17, 6:49 am, [EMAIL PROTECTED] wrote:
>
>> What are the considerations in choosing between:
>>
>>return [a, b, c]
>>
>> and
>>
>> return (a, b, c) # or return a, b, c
>>
>> Why is the immutable form the default?
>>
>
> Using a house definition from
[EMAIL PROTECTED] wrote:
> What are the considerations in choosing between:
>
>return [a, b, c]
>
> and
>
> return (a, b, c) # or return a, b, c
>
A common explanation for this is that lists are for homogenous
collections, tuples are for when you have heterogenous collections i.e.
re
On Mon, 17 Mar 2008 05:28:19 -0700, castironpi wrote:
> a tuple is a data
> structure such which cannot contain a refrence to itself.
>>> a = [] # a list
>>> b = (a, None) # a tuple
>>> a.append(b)
>>> print b
([([...], None)], None)
>>> b[0][0] is b
True
So, yes tuples can contain a refere
On Mar 17, 12:28 pm, [EMAIL PROTECTED] wrote:
> > Why is the immutable form the default?
>
> Using a house definition from some weeks ago, a tuple is a data
> structure such which cannot contain a refrence to itself. Can a
> single expression refer to itself ever?
Can't imagine why that feature
On Mar 17, 11:49 am, [EMAIL PROTECTED] wrote:
> What are the considerations in choosing between:
>
>return [a, b, c]
>
> and
>
> return (a, b, c) # or return a, b, c
>
> Why is the immutable form the default?
My understanding is that the immutable form is not the default -
neither form is
On Mar 17, 6:49 am, [EMAIL PROTECTED] wrote:
> What are the considerations in choosing between:
>
> return [a, b, c]
>
> and
>
> return (a, b, c) # or return a, b, c
>
> Why is the immutable form the default?
Using a house definition from some weeks ago, a tuple is a data
structure such whi
What are the considerations in choosing between:
return [a, b, c]
and
return (a, b, c) # or return a, b, c
Why is the immutable form the default?
--
http://mail.python.org/mailman/listinfo/python-list
16 matches
Mail list logo