the annoying, verbose self

MonkeeSage MonkeeSage at
Tue Nov 27 10:35:13 CET 2007

On Nov 27, 3:20 am, Roy Smith <r... at> wrote:

> If you want to have a little fun:
> class peverse:
>     def __call__(self):
>         raise AttributeError ("peverse instance has no __call__ method")
> x = peverse()
> x()

That is "peverse", but still...

from types import FunctionType
type(x) == FunctionType # False

And you can't (easily?) subclass FunctionType:

Error when calling the metaclass bases
  type 'function' is not an acceptable base type



More information about the Python-list mailing list