Mark Dickinson <dicki...@gmail.com> added the comment: > 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8023> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com