用法:
kind.description
說明 Parameter.kind 的枚舉值。
3.8 版中的新函數。
示例:打印參數的所有說明:
>>> def foo(a, b, *, c, d=10): ... pass >>> sig = signature(foo) >>> for param in sig.parameters.values(): ... print(param.kind.description) positional or keyword positional or keyword keyword-only keyword-only
相關用法
- Python inspect.Parameter.kind用法及代碼示例
- Python inspect.Parameter.replace用法及代碼示例
- Python inspect.Signature.from_callable用法及代碼示例
- Python inspect.isasyncgenfunction用法及代碼示例
- Python inspect.isawaitable用法及代碼示例
- Python inspect.BoundArguments.apply_defaults用法及代碼示例
- Python inspect.BoundArguments用法及代碼示例
- Python inspect.formatargspec用法及代碼示例
- Python inspect.Signature.replace用法及代碼示例
- 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.Parameter.kind.description。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。