Questions about subclassing an int
Francesco Guerrieri
f.guerrieri at gmail.com
Sat Jan 5 12:15:11 EST 2008
On Jan 4, 2008 11:55 PM, Steven W. Orr <steveo at syslang.net> wrote:
> class S(int):
> def __init__(self, value):
> self.value = value
> def addStr(self, str):
> self.doc = str
>
The original question has already been answered,
I only want to suggest to avoid shadowing builtin names,
like str in the above example.
Bye,
Francesco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080105/ad1b548a/attachment-0001.html>
More information about the Python-list
mailing list