Created
August 4, 2020 13:34
-
-
Save jeakwon/dffd3444d832388277b1fdcdfb46c3fa to your computer and use it in GitHub Desktop.
inspect class args
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
import inspect | |
class foo: | |
def __init__(self, a, b=10, *c, **d): | |
values = inspect.getargvalues(inspect.currentframe())[3] | |
print(values) | |
# {'d': {}, 'c': (), 'b': 10, 'a': 1, 'self': <__main__.foo object at 0x0000021BD7DEECF8>} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment