Re: What does this "See help(type(self)) for accurate signature." actually mean?

[email protected] (Stefan Ram) 16 Mar 2026 15:25:36 GMT
Newsgroups comp.lang.python
Organization Stefan Ram
Message-ID <[email protected]>
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:
. . .

>                                 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.