Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #197736
| From | Jon Ribbens <jon+usenet@unequivocal.eu> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: What does this "See help(type(self)) for accurate signature." actually mean? |
| Date | 2026-03-16 17:01 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <slrn10rgdrv.7ge.jon+usenet@raven.unequivocal.eu> (permalink) |
| References | <4b9i8m-p1m93.ln1@q957.zbmc.eu> <slrn10rfm6h.7ge.jon+usenet@raven.unequivocal.eu> <help-20260316162503@ram.dialup.fu-berlin.de> |
On 2026-03-16, Stefan Ram <ram@zedat.fu-berlin.de> wrote: > Jon Ribbens <jon+usenet@unequivocal.eu> 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.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar
What does this "See help(type(self)) for accurate signature." actually mean? Chris Green <cl@isbd.net> - 2026-03-15 09:05 +0000
Re: What does this "See help(type(self)) for accurate signature." actually mean? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-15 21:21 +0000
Re: What does this "See help(type(self)) for accurate signature." actually mean? Chris Green <cl@isbd.net> - 2026-03-16 08:53 +0000
Re: What does this "See help(type(self)) for accurate signature." actually mean? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-16 09:15 +0000
Re: What does this "See help(type(self)) for accurate signature." actually mean? Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-03-16 10:17 +0000
Re: What does this "See help(type(self)) for accurate signature." actually mean? ram@zedat.fu-berlin.de (Stefan Ram) - 2026-03-16 15:25 +0000
Re: What does this "See help(type(self)) for accurate signature." actually mean? Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-03-16 17:01 +0000
csiph-web