这个Python函数参数来自哪里?

2024-05-20 20:59:50 发布

您现在位置:Python中文网/ 问答频道 /正文

下面是我的函数的顶部(它是一个类的一部分,该类封装了Bill.com网站API):

def _get_objects(self,
                 bdco, 
                 refresh=False,
                 sort=[],
                 filters=[],
                 start=0, max=999,
                 include_inactive=False):
    """
    Retrieve (either from cache or the service directly) all of the object
     in question (e.g. Vendor, Customer, etc.)
    """

    if ('isActive','=','1') in filters \
       and bdco in ["MoneyMovement", "ReceivedPay"]:
        print bdco, filters
        import ipdb;ipdb.set_trace()
        raise Exception("Huh!?")

调用此函数的函数肯定不会传递任何“filters”参数或**kwargs(可能包含一个)。仍然:

ReceivedPay [('isActive', '=', '1')]
> /my_dir/simple_bdc.py(367)_get_objects()
    366             import ipdb;ipdb.set_trace()
--> 367             raise Exception("huh!?")
    368 

ipdb> 

我堆栈中的许多其他类都调用这个函数,所以我想知道是否有其他调用方以某种方式在这里设置了持久性的东西,但我完全被难住了。有什么办法可以排除故障吗?你知道吗

谢谢你!你知道吗


Tags: the函数inimportfalsegetobjectstrace