Re: [Tutor] Objects, object references, object values and memory addresses

2012-10-19 Thread Daniel Gulko
Great explanation Alan. I am a newbie at Python but descriptions like this really help me better understand. Thanks again. > To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Thu, 18 Oct 2012 08:32:41 +0100 > Subject: Re: [Tutor] Objects, object references, objec

Re: [Tutor] Objects, object references, object values and memory addresses

2012-10-18 Thread eryksun
On Thu, Oct 18, 2012 at 1:16 AM, Dave Angel wrote: > > may decide to reuse existing objects. This includes, ints, floats, > strings, byte strings, tuples, etc. In the particular case of CPython, > small integers are cached in this way, and so are short strings with no > whitespace. How small, a

Re: [Tutor] Objects, object references, object values and memory addresses

2012-10-18 Thread Alan Gauld
On 18/10/12 04:41, boB Stepp wrote: From Programming in Python 3, 2nd edition (p. 22-23): a = ["Retention", 3, None] b = ["Retention", 3, None] a is b False b = a a is b True My current understanding is as follows: On the first two lines, two separate objects are defined, stored in two sep

Re: [Tutor] Objects, object references, object values and memory addresses

2012-10-17 Thread Dave Angel
On 10/17/2012 11:41 PM, boB Stepp wrote: > >From Programming in Python 3, 2nd edition (p. 22-23): > a = ["Retention", 3, None] b = ["Retention", 3, None] a is b > False b = a a is b > True > > My current understanding is as follows: On the first two lines, two > separate ob

[Tutor] Objects, object references, object values and memory addresses

2012-10-17 Thread boB Stepp
>From Programming in Python 3, 2nd edition (p. 22-23): >>> a = ["Retention", 3, None] >>> b = ["Retention", 3, None] >>> a is b False >>> b = a >>> a is b True My current understanding is as follows: On the first two lines, two separate objects are defined, stored in two separate blocks of memory