This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, ughacks
Date 2010-02-26.11:13:35
SpamBayes Score 4.4324047e-06
Marked as misclassified No
Message-id <1267182817.75.0.994788905241.issue8023@psf.upfronthosting.co.za>
In-reply-to
Content
> So s.append(x) just copies the pointer, not the actual value.

Yes, that's a reasonable way to think about it (though the term 'reference' seems to more popular than 'pointer' in this context).  It matches the implementation, too: internally, a list is represented as a resizable array of pointers to objects.  (For CPython, anyway;  alternative implementations of Python might differ.)

Implicit object copies are rare in Python.

comp.lang.python is a good place to ask questions about Python's object model.
History
Date User Action Args
2010-02-26 11:13:37mark.dickinsonsetrecipients: + mark.dickinson, ughacks
2010-02-26 11:13:37mark.dickinsonsetmessageid: <1267182817.75.0.994788905241.issue8023@psf.upfronthosting.co.za>
2010-02-26 11:13:36mark.dickinsonlinkissue8023 messages
2010-02-26 11:13:35mark.dickinsoncreate