Which member is it?

Curtis Jensen cjensen at bioeng.ucsd.edu
Thu Jun 29 18:30:10 EDT 2000


class: Foo:
  def __init__(self):
    self.bar1 = [1,2,3]
    self.bar1 = [1,2,3]
    self.bar2 = [1,2]
    self.bar2 = [1,2,3,4]

tmp = Foo()

If I make reference to tmp.bar1, which do I get or, does it matter?
If I make reference to tmp.bar2, which do I get?  it will make a
difference here.

In my code, it seems tmp.bar1 doesn't seem to cause problems.  However,
tmp.bar2 does cause some funny problems, especialy when making calls to
C modules.  What exactly does python do when you reference same name
with different bindings?  Thanks.

-- 
Curtis Jensen
cjensen at bioeng.ucsd.edu
http://www-bioeng.ucsd.edu/~cjensen/
FAX (425) 740-1451



More information about the Python-list mailing list