multiple parameters to append()?
Lance E Sloan
lsloan at bigfoot.com
Mon Feb 19 20:28:41 EST 2001
I downloaded an old-ish Python module, Julian, and
my Python 2.0 complained about this line from its
Zone.py file (line 61):
self.ttinfos.append(up.unpack_int(), ord(data[6*i + 4]),
ord(data[6*i + 5]))
So I changed it to:
self.ttinfos.append((up.unpack_int(), ord(data[6*i + 4]),
ord(data[6*i + 5])))
Basically, I just added another set of parens to make the
arguments all part of a tuple that is appended instead.
I don't think this is correct, though. Although Python doesn't
complain any more, the module doesn't work exactly as
described.
I saw in the Python documentation that this multi-parameter
usage of append() is no longer allowed and has been
deprecated for some time. How exactly did the old usage
of append() work? I don't think I can correct the problem in
this module unless I know that.
More information about the Python-list
mailing list