[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-cpp-sig
Subject:    Re: [C++-sig] Derivation from Python str
From:       Hans Meine <hans_meine () gmx ! net>
Date:       2010-09-29 16:01:43
Message-ID: 201009291802.08576.hans_meine () gmx ! net
[Download RAW message or body]

Am Mittwoch 29 September 2010, 17:02:57 schrieb Willi Karel:
> I'd like to derive from either Python's built-in 'str' or
> boost::python::str, resulting in a class that provides additional
> methods / member functions / attributes. [...]

AFAIK this is just an unsupported feature of the BPL.  I was (and would still 
be) interested in the same thing, only with list/dict being the base classes, 
but this does not seem to be possible.

>From the outside, I would guess/hope that it's not too hard to fix, but having 
looked at various parts of boost::python in the past, I don't think that I 
will try it myself in the near future.

> Including e.g. boost::python::str in the list of base classes yields a
> run-time error in python: [...]

If it was supported, I would say that this would be the right approach/API.

Have a nice day,
  Hans
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic