Get built in method signature

How do I get the signature of built in methods? Example: dict().get(k)

>> a = dict().get
>> a
<built-in method get of dict object at 0x1003aafd0>
>> a.__doc__
'D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.'
>> import inspect
>> inspect.getargspec(a)
TypeError: <built-in method get of dict object at 0x100377250> is not a Python function

I would like to see the result like this

>> a.some_function()
('key', 'default'=None)

我认为这对于在C中实现的python中的内置函数来说是不可能的。请参阅此bug讨论以获取更多详细信息。

链接地址: http://www.djcxy.com/p/60352.html

上一篇: 来自Apple Accelerate Framework的conv

下一篇: 获取内置方法签名