Re: What does this "See help(type(self)) for accurate signature." actually mean?
Jon Ribbens <[email protected]> Mon, 16 Mar 2026 17:01:51 -0000 (UTC)
| Newsgroups | comp.lang.python |
|---|---|
| Organization | A noiseless patient Spider |
| Message-ID | <[email protected]> |
On 2026-03-16, Stefan Ram <[email protected]> wrote: > Jon Ribbens <[email protected]> wrote or quoted: >> I don't know why it says "type(self)", >>because help(foo) where 'foo' is an instance of a class 'xyz' >>seems to display the same as help(xyz) anyway. > >|Python 3.14 > >|>>> import types > >|>>> self = types.SimpleNamespace() > >|>>> self.__doc__ = "my custom doc" > >|>>> help(self) >|Help on SimpleNamespace: >|namespace(__doc__='my custom doc') >| my custom doc > >|>>> help(type(self)) >|Help on class SimpleNamespace in module types: >|class SimpleNamespace(builtins.object) >| | SimpleNamespace(mapping_or_iterable=(), /, **kwargs) >| | A simple attribute-based namespace. >| | Methods defined here: > . . . Ok, but does anyone ever set __doc__ on instances? That's a pretty weird thing to do. >> the class itself doesn't have >>a docstring either. So there is nothing to display no matter what >>you type. > > Even without docstrings, info about names, parameters etc. is shown. Yes, everyone can see that from what OP has already posted here.