[issue11470] Flag inappropriate uses of callable class attributes
report at bugs.python.org
Thu Mar 17 18:30:45 CET 2011
Thomas Wouters <thomas at python.org> added the comment:
New version of the patch; instead of triggering at attribute *access*, this just checks when creating types and in type_setattro. It also makes the warning a newly added CompatibilityWarning. Also, instead of warning for all non-descriptors, it now only warns for PyCFunctionObjects that do not have a __self__ set, or of which __self__ is a module. (The reason for the latter being the new-ish behaviour of functions defined in modules in C getting passed something as __self__, defaulting to the module.) I've removed a few staticmethod calls from cases that do not trigger the new warning.
This patch still lacks tests and doc updates, but I'm uploading right now because the sprints apparently lose internet soonish.
Added file: http://bugs.python.org/file21271/nonmethod-warn.diff
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list