> Michael (M) wrote:
>M> While thinking about Steven D'Aprano's thread about automatically
>M> generating arithmetic operations for a subclass, I stumbled upon
>M> something confusing. Having defined the following class to do funky
>M> addition,
>M> class MyInt(int):
>M> def __getattrib
Michael wrote:
While thinking about Steven D'Aprano's thread about automatically
generating arithmetic operations for a subclass, I stumbled upon
something confusing. Having defined the following class to do funky
addition,
class MyInt(int):
def __getattribute__(self, key):
if key =
Hmm... I meant to create a new thread, as does GMail when you edit the
subject. Pardon my Google-Groups newbieness. - Michael
--
http://mail.python.org/mailman/listinfo/python-list
While thinking about Steven D'Aprano's thread about automatically
generating arithmetic operations for a subclass, I stumbled upon
something confusing. Having defined the following class to do funky
addition,
class MyInt(int):
def __getattribute__(self, key):
if key == "__add__":