Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

func_noerror_classes_meth_could_be_a_function.py 663B

123456789101112131415161718192021222324252627282930313233
  1. # pylint: disable=C0111,R0903,W0232
  2. """
  3. #2479
  4. R0201 (formely W0212), Method could be a function shouldn't be emitted in case
  5. like factory method pattern
  6. """
  7. __revision__ = 1
  8. class XAsub(object):
  9. pass
  10. class XBsub(XAsub):
  11. pass
  12. class XCsub(XAsub):
  13. pass
  14. class Aimpl(object):
  15. # disable "method could be a function" on classes which are not overriding
  16. # the factory method because in that case the usage of polymorphism is not
  17. # detected
  18. # pylint: disable=R0201
  19. def makex(self):
  20. return XAsub()
  21. class Bimpl(Aimpl):
  22. def makex(self):
  23. return XBsub()
  24. class Cimpl(Aimpl):
  25. def makex(self):
  26. return XCsub()