说我有两种方法first_method
,second_method
如下所示。
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!")
我如何检查(什么条件)第一种方法正在调用第二种方法并根据该方法处理该方法?