Say i have two methods first_method
and second_method
as follows.
def first_method(some_arg):
"""
This is the method that calls the second_method
"""
return second_method(some_arg[1], some_arg[2])
def second_method(arg1, arg2):
"""
This method can only be called from the first_method
or it will raise an error.
"""
if (some condition):
#Execute the second_method
else:
raise SomeError("You are not authorized to call me!")
How can i check (what condition(s)) that second method is being called by the first method and process the method according to that ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…