Message3920
Logged In: YES
user_id=52572
Though I haven't checked out the latest from CVS, I'm at a
loss to explain the results Lorien is getting. In
particular, Boost.Python class instances have a __class__
attribute, and Boost.Python classes have a __bases__
attribute that is a tuple. Isn't that all that should be
needed for isinstance() to work properly?...
Aha, now I remember: The first base class in the list
controls which metaclass object gets control when a derived
class is created. So the declaration of MyDerivedClass
below actually creates a regular Python class with a base
that is a Boost.Python class. At that point, everything is
beyond my control. To get it to work, at least begin by
swapping the order of the base classes.
I wonder if it would make sense to always defer to the
first extension type's type (if any) for subclass creation?
It's not a general solution (i.e. what if you have multiple
extension types in the __bases__ tuple?) but at least it
would handle this case. Surely it's less likely that a
regular Python class can make any sane use of methods from
an extension class.
-Dave |
|
Date |
User |
Action |
Args |
2007-08-23 13:53:34 | admin | link | issue409355 messages |
2007-08-23 13:53:34 | admin | create | |
|