On 9/19/06, Magnus Lycka <[EMAIL PROTECTED]> wrote:
> Fredrik Lundh wrote:
> > this article
> >
> > http://effbot.org/zone/python-objects.htm
> >
> > may be useful for those who haven't already seen it.
>
> I don't know how many times I've referred to, or paraphrased,
> that article. Shouldn't
Magnus Lycka schrieb:
> > http://effbot.org/zone/python-objects.htm
> > may be useful for those who haven't already seen it.
>
>Shouldn't it be incorporated into the standard tutorial?
>I think it's very helpful for people who are used
> to the way C etc handles variables.
That would also be
Fredrik Lundh wrote:
> this article
>
> http://effbot.org/zone/python-objects.htm
>
> may be useful for those who haven't already seen it.
I don't know how many times I've referred to, or paraphrased,
that article. Shouldn't it be incorporated into the standard
tutorial? I think it's very he
John Henry wrote:
> Hi list,
>
> Just to make sure I understand this.
>
> Since there is no "pointer" type in Python, I like to know how I do
> that.
>
> For instance, if I do:
>
>...some_huge_list is a huge list...
>some_huge_list[0]=1
>aref = some_huge_list
>aref[0]=0
>pri
John Henry a écrit :
> Hi list,
>
> Just to make sure I understand this.
>
> Since there is no "pointer" type in Python, I like to know how I do
> that.
>
> For instance, if I do:
>
>...some_huge_list is a huge list...
>some_huge_list[0]=1
>aref = some_huge_list
>aref[0]=0
>
Dennis Lee Bieber wrote:
> References to lists, dictionaries, and class instances (which are,
> in a way, just an expanded dictionary) are "mutable"
careful: it's not the *reference* that's mutable, it's the object.
the *only* difference between mutable and immutable objects is that
the la
Grant Edwards wrote:
> On 2006-09-13, John Henry <[EMAIL PROTECTED]> wrote:
> > So, if I understand you correctly, I must make the reference
> > to a more elaborate representation. Like:
> >
> >i=[1,]
> >j=i
> >j[0]=2
> >print i
> >
> > in order to get 2 printed.
> >
> > Correct?
Thanks for the reply, Grant.
I am not doing things like that - I am just trying to clear up in my
mind the Python concepts.
I understand it now.
Grant Edwards wrote:
> On 2006-09-13, John Henry <[EMAIL PROTECTED]> wrote:
> > Thanks for the reply, both to Laszlo and Steve.
> >
> > Okay, I under
On 2006-09-13, John Henry <[EMAIL PROTECTED]> wrote:
> Thanks for the reply, both to Laszlo and Steve.
>
> Okay, I understand what you're saying.
>
> But what if I need to make a "pointer" to a simple variable.
There's no such thing as a "simple variable". There are
mutable objects and immutable
Thanks for the reply, both to Laszlo and Steve.
Okay, I understand what you're saying.
But what if I need to make a "pointer" to a simple variable.
For instance, in C:
int i=1
int *j=&i
*j = 2
print i
and you get 2 printed.
In Python,
i=1
j=i
j=2
print i
and you get
John Henry wrote:
> Hi list,
>
> Just to make sure I understand this.
>
> Since there is no "pointer" type in Python, I like to know how I do
> that.
>
> For instance, if I do:
>
>...some_huge_list is a huge list...
>some_huge_list[0]=1
>aref = some_huge_list
>aref[0]=0
>pri
John Henry írta:
> Hi list,
>
> Just to make sure I understand this.
>
> Since there is no "pointer" type in Python, I like to know how I do
> that.
>
> For instance, if I do:
>
>...some_huge_list is a huge list...
>some_huge_list[0]=1
>aref = some_huge_list
>aref[0]=0
>print so
Hi list,
Just to make sure I understand this.
Since there is no "pointer" type in Python, I like to know how I do
that.
For instance, if I do:
...some_huge_list is a huge list...
some_huge_list[0]=1
aref = some_huge_list
aref[0]=0
print some_huge_list[0]
we know that the answere
13 matches
Mail list logo