consider my scenario, I have a method which is kind of a factory that returns me the action based on the status that I pass.
def factory(status):
action = {
1: action_1,
2: action_2,
3: action_3,
}.get(status)
return action
and these are the actions,
def action_1():
# making db call
action_1_db_call()
def action_2():
# making db call
action_2_db_call()
def action_3():
# It will do nothing
pass
I will basically do the following in the main code,
action = factory(1)
action()
So here, which is the right approach for action_3? Can I just use pass
for this method or I should return None
. which one is advisable and a good practice?