How To capture an id into an array..
Terry Reedy
tjreedy at udel.edu
Sun Mar 28 23:22:34 EST 2004
"BALAJI RAMAN" <balajibalaraman2001 at yahoo.co.in> wrote in message
news:c47mnp+dot0 at eGroups.com...
> class V(E):
> """ This is a variable for MPY"""
> def __init__(self):
> print id(self)
> check=[]
> check.append(id(self))
> self.val = None
Objects ids are pretty useless. I suspect that you actually want a list of
objects, not a list of ids. In other words, after you move the check
initialization outside of __init__, check.append(self) instead.
Terry J. Reedy
More information about the Python-list
mailing list