[C++-sig] deriving basic python type

Alex alex at glumol.com
Tue Aug 5 00:51:48 CEST 2003


Hi 
In python I can do this : 

class my_int(int):
 def __rshift__(self, a):    #changing the >> operator behavior for example... 
        return self + a

The example is quite stupid but is there a way I can make such a class in C++(a class deriving the python int or other python types)  then exporting it in python ?


a python question:
can't we overload the = operator in python ?? 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030805/b7fb1efe/attachment.htm>


More information about the Cplusplus-sig mailing list