reference to objects

Johannes Zellner johannes at zellner.org
Fri Oct 13 16:42:02 EDT 2000


Hello,

what happens in python if I assing an object to different
variables ?

e.g.:

    class Lola:
        def __init__(x):
            x.y = 0

    l = Lola()
    g = l       # <-- !!

now, does g.y = 1 modify l.y ?
(do both variables refer to the same object ?

-- 
   Johannes



More information about the Python-list mailing list