[C++-sig] Re: deriving basic python type

Gottfried.Ganssauge at HAUFE.DE Gottfried.Ganssauge at HAUFE.DE
Mon Aug 11 09:26:23 CEST 2003


Arrh ... to be honest: not at all.
I'm back from my vacation today and planned to have a first version by
friday.

Cheers,

Gottfried

> -----Original Message-----
> From: David Abrahams [mailto:dave at boost-consulting.com]
> Sent: Tuesday, August 05, 2003 2:58 PM
> To: c++-sig at python.org
> Cc: Gottfried Gan?auge
> Subject: [C++-sig] Re: deriving basic python type
> 
> 
> "Alex" <alex at glumol.com> writes:
> 
> > 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 ?
> 
> There's no *easy* way right now, but it's a fairly easy mod to the
> Boost.Python sources.  Gottfried Ganßauge has been working on a patch
> for another purpose which should make it possible.  Gottfried, how's
> it coming along?
> 
> -- 
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
> 
> 
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030811/10f4e418/attachment.htm>


More information about the Cplusplus-sig mailing list