refactor: add class decorator to class method
This commit is contained in:
19
dopey.py
Normal file → Executable file
19
dopey.py
Normal file → Executable file
@@ -104,16 +104,17 @@ class Operation:
|
|||||||
if Memory.buffer[Memory.get_pointer()]:
|
if Memory.buffer[Memory.get_pointer()]:
|
||||||
program[1] = last_open_loop_pos
|
program[1] = last_open_loop_pos
|
||||||
|
|
||||||
def get_operations_in_switch() -> Dict:
|
@classmethod
|
||||||
|
def get_operations_in_switch(cls) -> Dict:
|
||||||
return {
|
return {
|
||||||
Operation.SHIFT_LEFT: Operation.shift_left,
|
cls.SHIFT_LEFT: cls.shift_left,
|
||||||
Operation.SHIFT_RIGHT: Operation.shift_right,
|
cls.SHIFT_RIGHT: cls.shift_right,
|
||||||
Operation.INCREMENT: Operation.increment,
|
cls.INCREMENT: cls.increment,
|
||||||
Operation.DECREMENT: Operation.decrement,
|
cls.DECREMENT: cls.decrement,
|
||||||
Operation.OUTPUT: Operation.output,
|
cls.OUTPUT: cls.output,
|
||||||
Operation.INPUT: Operation.input,
|
cls.INPUT: cls.input,
|
||||||
Operation.OPEN_LOOP: Operation.open_loop,
|
cls.OPEN_LOOP: cls.open_loop,
|
||||||
Operation.CLOSE_LOOP: Operation.close_loop
|
cls.CLOSE_LOOP: cls.close_loop
|
||||||
}
|
}
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user