用法:
classmethod from_callable(obj, *, follow_wrapped=True, globalns=None, localns=None)返回給定可調用
obj的Signature(或其子類)對象。傳遞follow_wrapped=False以獲取obj的簽名,而不打開其__wrapped__鏈。globalns和localns將在解析注釋時用作命名空間。此方法簡化了
Signature的子類化:class MySignature(Signature): pass sig = MySignature.from_callable(min) assert isinstance(sig, MySignature)3.5 版中的新函數。
3.10 版中的新函數:
globalns和localns參數。
相關用法
- Python inspect.Signature.replace用法及代碼示例
- Python inspect.Parameter.replace用法及代碼示例
- Python inspect.Parameter.kind用法及代碼示例
- Python inspect.isasyncgenfunction用法及代碼示例
- Python inspect.isawaitable用法及代碼示例
- Python inspect.BoundArguments.apply_defaults用法及代碼示例
- Python inspect.BoundArguments用法及代碼示例
- Python inspect.Parameter.kind.description用法及代碼示例
- Python inspect.formatargspec用法及代碼示例
- Python inspect.signature用法及代碼示例
- Python inspect.getcallargs用法及代碼示例
- Python scipy integrate.trapz用法及代碼示例
- Python int轉exponential用法及代碼示例
- Python integer轉string用法及代碼示例
- Python scipy interpolate.CubicHermiteSpline.solve用法及代碼示例
- Python scipy interpolate.CubicSpline.solve用法及代碼示例
- Python int.from_bytes用法及代碼示例
- Python scipy integrate.cumtrapz用法及代碼示例
- Python scipy interpolate.PchipInterpolator.solve用法及代碼示例
- Python int.bit_length用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 inspect.Signature.from_callable。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
