Pretty much all python methods should have "self" as their first argument. One key exception, however, is __new__. This special method is supposed to have "cls" as its first argument, since it operates on a class rather than an instance. However, when __new__ is properly given "cls" as its first argument, kdev-python incorrectly labels this as a problem and says that it should be "self". Reproducible: Always Steps to Reproduce: 1. Create a class 2. Create a "__new__" method 3. make "cls" the first argument of the __new__method Actual Results: kdev-python says it should be "self" Expected Results: kdev-python finds no error. kdev-python really should label it as a problem if anything other than "cls" is the first argument in the __new__ method.
Git commit 43f49dd95d5ac85f6757b4e897e43723e0881480 by Sven Brauch, on behalf of Levente Kurusa. Committed on 26/11/2013 at 21:26. Pushed by brauch into branch 'master'. Fix warning if __new__ argument is called cls, not self This patch fixes a warning on __new__ method argument complaining about the usage of self instead of cls. REVIEW:114084 GCI-TASK:5883312908271616 M +19 -6 duchain/declarationbuilder.cpp M +21 -0 duchain/tests/pyduchaintest.cpp M +2 -0 duchain/tests/pyduchaintest.h http://commits.kde.org/kdev-python/43f49dd95d5ac85f6757b4e897e43723e0881480