Why does python behave so? (removing list items)
Steven D'Aprano
steve at REMOVE-THIS-cybersource.com.au
Wed Mar 26 23:30:58 EDT 2008
On Wed, 26 Mar 2008 23:12:27 +0100, Thomas Dybdahl Ahle wrote:
> On Wed, 2008-03-26 at 23:04 +0100, Michał Bentkowski wrote:
>> Why does python create a reference here, not just copy the variable?
>
> Python, like most other oo languages, will always make references for =,
> unless you work on native types (numbers and strings).
*Including* numbers and strings.
I don't know what you mean "native types". If you mean that numbers and
strings are low-level bytes like you get in C, then you are mistaken,
because EVERYTHING in Python is an object, including numbers and strings.
--
Steven
More information about the Python-list
mailing list