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_base_init_vars.py 772B

1234567891011121314151617181920212223242526272829303132333435
  1. # pylint:disable=R0201, print-statement, too-few-public-methods
  2. """Checks that class variables are seen as inherited !
  3. """
  4. __revision__ = ''
  5. class BaseClass(object):
  6. """A simple base class
  7. """
  8. def __init__(self):
  9. self.base_var = {}
  10. def met(self):
  11. """yo"""
  12. def meeting(self, with_):
  13. """ye"""
  14. return with_
  15. class MyClass(BaseClass):
  16. """Inherits from BaseClass
  17. """
  18. def __init__(self):
  19. BaseClass.__init__(self)
  20. self.var = {}
  21. def met(self):
  22. """Checks that base_var is not seen as defined outsite '__init__'
  23. """
  24. self.var[1] = 'one'
  25. self.base_var[1] = 'one'
  26. return self.base_var, self.var
  27. if __name__ == '__main__':
  28. OBJ = MyClass()
  29. OBJ.met()