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.

too_few_public_methods.py 884B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # pylint: disable=missing-docstring
  2. from __future__ import print_function
  3. from enum import Enum
  4. class Aaaa(object): # [too-few-public-methods]
  5. def __init__(self):
  6. pass
  7. def meth1(self):
  8. print(self)
  9. def _dontcount(self):
  10. print(self)
  11. # Don't emit for these cases.
  12. class Klass(object):
  13. """docstring"""
  14. def meth1(self):
  15. """first"""
  16. def meth2(self):
  17. """second"""
  18. class EnoughPublicMethods(Klass):
  19. """We shouldn't emit too-few-public-methods for this."""
  20. class BossMonster(Enum):
  21. """An enum does not need methods to be useful."""
  22. megashark = 1
  23. octopus = 2
  24. class DumbList(object):
  25. """A class can define only special methods."""
  26. def __setattr__(self, key, value):
  27. return key + value
  28. def __len__(self):
  29. return 0
  30. def __getitem__(self, index):
  31. return index