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(PyExc_TypeError, "'%s' object is not callable", callable->ob_type->tp_name); return -1; } so when use staticmethod and classmethod on a class variable, there are two different behavior. class Test(object): name = "s7v7nislands" name = classmethod(Test.name) # will raise error. name = staticmethod(Test.name) # will not raise error. My idea is: here, the two functions (or maybe classes) should have the same behavior). so is this a bug or something I missing ? thanks! s7v7nislands
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4