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.

keyword_arg_before_vararg.py 1000B

1234567891011121314151617181920212223242526272829303132333435
  1. """Unittests for W1125 (kw args before *args)"""
  2. from __future__ import absolute_import, print_function
  3. # pylint: disable=unused-argument
  4. def check_kwargs_before_args(param1, param2=2, *args): # [keyword-arg-before-vararg]
  5. """docstring"""
  6. pass
  7. check_kwargs_before_args(5)
  8. # pylint: disable=too-few-public-methods, invalid-name
  9. class AAAA(object):
  10. """class AAAA"""
  11. def func_in_class(self, param1, param2=2, *args): # [keyword-arg-before-vararg]
  12. "method in class AAAA"
  13. pass
  14. @staticmethod
  15. def static_method_in_class(param1, param2=3, *args): # [keyword-arg-before-vararg]
  16. "static method in class AAAA"
  17. pass
  18. @classmethod
  19. def class_method_in_class(cls, param1, param2=4, *args): # [keyword-arg-before-vararg]
  20. "class method in class AAAA"
  21. pass
  22. some_var = AAAA()
  23. some_var.func_in_class(3)
  24. some_var.static_method_in_class(4)
  25. AAAA.static_method_in_class(4)
  26. some_var.class_method_in_class(5)
  27. AAAA.class_method_in_class(5)