Re: [Python-Dev] why different between staticmethod and classmethod on non-callable object?

2009-09-02 Thread xiaobing jiang
the three types: function, classmethod, staticmethod are descriptors. but staticmethod's __get__ return the orignal value, others return object of instancemethod. (from souce in Objects/funcobject.c) so the staticmethod just like a wrap that make the wrapped object 'frozen'. like in your example.

[Python-Dev] why different between staticmethod and classmethod on non-callable object?

2009-08-31 Thread xiaobing jiang
hi all: In the svn thunk tree, I find in file Object/funcobject.c, the two functions: sm_init and cm_init have a little different. the cm_init function will check the object is really callable, but the sm_init don't. the code like this: if (!PyCallable_Check(callable)) { PyErr_Format(Py