[C++-sig] Sorry for my absence

Nick Rasmussen nick at ilm.com
Mon Mar 14 18:09:55 CET 2005


On Fri, 11 Mar 2005, David Abrahams wrote:

> David Abrahams <dave at boost-consulting.com> writes:
> 
> Probably a better thing to do would be to fake the __class__ into
> being a dummy class derived from PyCFunction_Type, with a noticeably
> different name and a big ugly docstring explaining why it exists.
> That way anyone looking at the __class__ attribute will have a clue
> what's going on.  If you could make that patch, I'd appreciate it.

I don't think that's possible, for the same reason we can't inherit
from it for the boost function objects.  Trying it out in the
interpreter, I got:

>>> import types
>>> class Foo(types.BuiltinFunctionType):
...   '''subclass of BuiltinFunctionType'''
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: type 'builtin_function_or_method' is not an acceptable base type

-nick




More information about the Cplusplus-sig mailing list