Optimization of Tuples and Strings

Matt Gerrans mgerrans at mindspring.com
Mon Jan 7 02:23:59 EST 2002


Anyone here know whether Python treats strings and tuples the way Java does
Strings?   That is, since they are immutable, does it just "point" multiple
references to an identical tuple to the same object?  For example:

x = (1,2)
y = (1,2)

Are x and y really referring to the same object?

- Matt





More information about the Python-list mailing list