Why does super(bool) give None
Cecil Westerhof
Cecil at decebal.nl
Fri Apr 24 07:42:01 EDT 2020
Cecil Westerhof <Cecil at decebal.nl> writes:
>> I've never actually looked at the repr of a super object - I've always
>> just called a method on it immediately after constructing it. Never
>> seen a need to hang onto one :)
>
> Well, maybe I will never need it, but I am just curious. And sometimes
> it was very handy that I had sought out 'useless' things.
You can get the information with the inspect module (done with
ipython3):
In [1]: import inspect
In [2]: inspect.getmro(bool)
Out[2]: (bool, int, object)
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
More information about the Python-list
mailing list