What is a way to extract arguments from __init__
without creating new instance.
The code example:
class Super:
def __init__(self, name):
self.name = name
I am looking something like Super.__dict__.keys()
type solution. Just to retrieve name argument information without adding any values. Is there such an option to do that?
You can use
inspect
Edit:
inspect.getargspec
doesn't actually create an instance ofSuper
, see below:This outputs:
Note that
instantiated
never got printed.