Lawrence Benson points out that if you don't include an __init__
in your class, then it will inherit from a superclass by default in this post.
Python Docs supports this when stating that, "a class may define a special method named __init__()
."
Is there any way to print/display a description of the __init__()
or __new__()
methods that apply to a particular class? Meaning - in the interpreter, can I run a command that will return them?
I've tried to run everything I can find in __dir__
, to no avail:
>>>__dir__
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'drive']