On Sat, Dec 11, 2021, 1:19 PM Christopher Barker <python...@gmail.com> wrote:
> .... > > Where/how should class attribute doc strings be stored? > > Tacked on to the class __doc__ ? > > Another dict? > > __attr_doc__ > > Added to __annotaions__ ? > > Something else? > > If they are to be available at run time, they need to go somewhere… > > -CHB > >> >> -- > Christopher Barker, PhD (Chris) > The __annotations__ already exists. Is that a point in favor? If the syntax could become sugar for creating an Annotated object in __annotations__, this would be a pretty convenient location to find them. On the other hand, not every type hinted variable will have a docstring. It might be inconvenient to have them there only. It seems like storing them in a so called __attr_doc__ might be the most straightforward thing to do. If that were done, does it matter that the contents of __attr_doc__ and __annotations__ are not coupled? The strings might need to be modified. Would be inconvenient to have to modify two places in such a situation.
_______________________________________________ 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/7S4RM4APDP4FC7L6DBHJU7GAHES3ABPV/ Code of Conduct: http://python.org/psf/codeofconduct/