This repository was archived by the owner on Jun 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathlisting.py
More file actions
81 lines (55 loc) · 1.36 KB
/
Copy pathlisting.py
File metadata and controls
81 lines (55 loc) · 1.36 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env python
# coding: utf-8
"""
"""
import string
import string # noqa
module_variable = 0
float = 1.0
long = "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"
def functionName(self, int): # noqa
local = 5 + 5
module_variable = 5*5
return module_variable
class my_class(object):
def __init__(self, arg1, string):
self.value = True
return
def method1(self, str):
self.s = str
return self.value
def method2(self):
return
print('How did we get here?')
def method1(self):
return self.value + 1
method2 = method1
class my_subclass(my_class):
def __init__(self, arg1, string):
self.value = arg1
return
class Food(object):
pass
class Pizza(Food):
pass
# test recommendations from http://legacy.python.org/dev/peps/pep-0008/#programming-recommendations
# http://legacy.python.org/dev/peps/pep-0008/#constants
food = Food()
pizza = Pizza()
print(type(food) == type(pizza))
print(isinstance(food, Food))
print(isinstance(pizza, Food))
# create a larger Cyclomatic complexity, error triggered with
# flake8 --max-complexity=5
def f(x):
if x is 1:
return x
elif x is 2:
return x
elif x is 3:
return x
elif x is 4:
return x
elif x is 5:
return x
print(f(5))