Comply with PEP8
Closed this issue · 0 comments
The code has multiple PEP8 violations to be fixed, including but not limited to:
-
two blank lines before a class declaration (L12, L17, L25, L31, L35)
-
use new style classes:
class ClassName(object):
(L35) -
2 spaces before comment:
#
(L44 and more) -
block comment should start with a pound and a space after it (L48, L91, L199, L204, L315)
-
missing spaces around operators:
3*x
->3 * x
,self.actions+="y"
->self.actions += 'y'
I'm also leaving here a couple other minor issues which are not exactly PEP8:
-
use
.format
instead of%
for string formatting. -
cannot return value from init (L52, L66, L72, L95, L101)
If you need a catastrophic failure here, raise an exception, preferably a custom one for clarity.
-
use
setup_req.UnitType in {0x06, 0x07}
instead ofor
L90Using set membership will make your condition shorter and more readable, esp. if you need to add another value
later on. -
In my opinion I would remove the
t1
variable or if you want to keep it, use a clearer name such asloop_thread
(L102) -
variable
ACTION_SIZE
should be lowercase. (L116)This is irrelevant once #3 is fixed