If one does dir()
on some builtin callables (class constructors, methods, etc) on CPython 3.4, one finds out that many of them often have a special attribute called __text_signature__
, for example:
>>> object.__text_signature__
'()'
>>> int.__text_signature__
>>> # was None
However the documentation for this is nonexistent. Furthermore, googling for the attribute name suggests that there is also another possible special attribute __signature__
, though I did not find any built-in functions that would have it.
I do know they are related to the function argument signature, but nothing beyond that, what do their values signify and what is the use of them?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…