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.

missing_self_argument.py 510B

1234567891011121314151617181920
  1. """Checks that missing self in method defs don't crash Pylint."""
  2. class MyClass(object):
  3. """A class with some methods missing self args."""
  4. def __init__(self):
  5. self.var = "var"
  6. def method(): # [no-method-argument]
  7. """A method without a self argument."""
  8. def setup(): # [no-method-argument]
  9. """A method without a self argument, but usage."""
  10. self.var = 1 # [undefined-variable]
  11. def correct(self):
  12. """Correct."""
  13. self.var = "correct"