Message 14100 - Python tracker (original) (raw)

Logged In: YES user_id=6380

Not convinced; there are subtle things you might want to do with classmethod (and staticmethod) that a type check would prevent.

I could live with something that checks whether the argument is callable.

There are definitely some weird things:

C.x = classmethod(12) C.x() Traceback (most recent call last): File "", line 1, in ? SystemError: ../Objects/classobject.c:2081: bad argument to internal function

vs.

C.x = staticmethod(12) C.x() Traceback (most recent call last): File "", line 1, in ? TypeError: 'int' object is not callable

Anyway I have bigger fish to fry for now.