Hmmm, well it seems that we already have support for class attribute 
docstrings, since Python 3.8.

It's not documented, but soon will be.

https://bugs.python.org/issue46076


   class Card:
      """A card from a standard French deck"""
      __slots__ = {
          'suit': 'Either "Spades", "Hearts", "Clubs" or "Diamonds"',
          'rank': 'A positive integer in the range 2 <= x <= 14'
          }


help() already knows to read the docstrings from the slot dict values.


-- 
Steve
_______________________________________________
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/BI2XVQAVFMMUHY3WAEGB3FYQ6D6RHX26/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to