Extending the 'function' built-in class

G. grumsk at grumsk.tz
Sun Dec 1 20:37:46 CET 2013


Le 01-12-2013, Roy Smith <roy at panix.com> a écrit :
>
> class foo(type(open)):
>     pass
>
> I get:
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: Error when calling the metaclass bases
>     type 'builtin_function_or_method' is not an acceptable base type
>
> So, we're back to asking what version you're using and what error 
> message you got.

Hi, I don't care that much for the version, since I wanted rather to perform
some tests. I tried your code with various versions and got the same message
than yours. Thus I guess the type can't be extended. Regards, G.



More information about the Python-list mailing list