Type emulation issues with new style classes

Michele Simionato michele.simionato at poste.it
Sun Feb 29 04:53:53 EST 2004


"Chris" <feb04.20.netman at spamgourmet.com> wrote in message news:<Fz30c.7220$TF2.5832 at nwrdny02.gnilink.net>...
> I need to know how I can do what I previously demonstrated with an old style
> class, that is hook into Python's introspection mechanism to dynamically
> provide an  __int__ method (or optionally __str__, __lt__, __le__, __eq__
> ,__ne__, __gt__, __ge__, __len__, __getitem__, __add__, __sub__, __mul__,
> __floordiv__, __mod__, __divmod__, __pow__, __lshift__, ... ad nausuem).
> Old style classes will let me do this, but I cannot determine how to do this
> with new style classes.
> 
> Chris

You may want to look at this thread:

http://groups.google.it/groups?hl=it&lr=&ie=UTF-8&threadm=2259b0e2.0311240603.549943b3%40posting.google.com&rnum=1&prev=/groups%3Fhl%3Dit%26lr%3D%26ie%3DISO-8859-1%26q%3Dinnermethods%26meta%3Dgroup%253Dcomp.lang.python.*

It does not solve your problem, but it may be of some interest.

           Michele Simionato



More information about the Python-list mailing list