/
some_module.py
62 lines (39 loc) · 1.09 KB
/
some_module.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""Bogus module for testing."""
# pylint: disable=missing-docstring,disallowed-name,invalid-name,no-self-use
MODULE_LEVEL_ATTRIBUTE = "test"
class SomeClass:
CLASS_VALUE = "class_method"
def __init__(self):
self.instance_value = "instance_method"
@classmethod
def class_method(cls):
return cls.CLASS_VALUE
@classmethod
def class_method_with_args(cls, a):
return a
@staticmethod
def static_method():
return "static_method"
@staticmethod
def static_method_with_args(a):
return a
def instance_method(self):
return self.instance_value
def instance_method_with_args(self, a):
return a
class DerivedClass(SomeClass):
pass
class ModuleClass:
def __init__(self, x, y):
self.x = x
self.y = y
def a(self):
return self.x + self.y
def module_function(x, y):
return x - y
async def async_function(x, y):
return x - y
def kwargs_only_func1(foo, *, bar, baz=5):
return foo + bar + baz
def kwargs_only_func2(foo, *, bar, baz):
return foo + bar + baz