Created
September 9, 2022 10:00
-
-
Save koi8-r/4d775b05dc64ef0f264b374e257f1b18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from inspect import Parameter, signature | |
from typing import Any, Optional | |
def fn(i: int, z: Optional[str] = None, *a, v: int = -1, **kw: Any): | |
pass | |
if __name__ == '__main__': | |
p = signature(fn).parameters | |
v: Parameter | |
for k, v in p.items(): | |
print('name =', repr(k)) | |
print('name =', v.name) | |
print('default =', v.default) | |
print('kind =', v.kind) | |
print('annotation =', v.annotation) | |
print('-' * 24) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment