csci-arch/stibnite

Refactor for eval statements

Opened this issue · 0 comments

What should be refactored?

Eval statements should be removed and written again more smartly and without them.

Why should it be refactored?

Because they are a source of possible future bugs

How should it be refactored?

With the help of a dictionary filled with possible functions, we can refactor them like this:

func_dict = {
    "constant_one":function_one,
    "constant_two":function_two,
    "constant_three":function_three,
}

func_dict[constant_one]()