On Tue, Dec 14, 2021, 9:49 PM Paul Bryan <pbr...@anode.ca> wrote: > Interesting. Some apparent downsides: > > - doesn't apply to class attributes > - objects with `__slots__` can't dynamically add attributes >
Also doesn't apply to module level members. To my mind these are significant downsides. And it also represents yet another way people are documenting attributes in the wild. Here's another I learned if which is supported by sphinx autodoc: comment tag colon docstring attribute statement Example: #: spam x = 1 Using this style, the documentation has to come before the attribute. Obviously- unless VERY big change is introduced- this "docstring" will never be runtime accessible since it's a comment. But it does represent yet another way people are doing documentation in the wild. Sigh. Rick.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/NTYRIIDYNJUUKT4PCVJEHOBFQDOQ32JP/ Code of Conduct: http://python.org/psf/codeofconduct/