Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
> Is there any discussion concerning what syntax might be used for > docstrings associated with objects ? I don't know about PyDoc in general, but I would expect help(obj) to just use obj.__doc__ which will return the instance docstring if it exists, and if not, the type docstring (if it exists). No new syntax is required, the standard ``help(obj)`` is sufficient. > (There seem to be some partial > solutions added on top of the Python parser (I think `epydoc` offered > one), but it would be nice to have a built-in solution to avoid having > to re-invent wheels. Are you suggesting we need new syntax to automatically assign docstrings to instances? I don't think we do. I expect that if you want to set a custom instance docstring, you would just say ``instance.__doc__ = "The doc string"`` after creating the instance, or ``self.__doc__ = "..."`` inside the __init__ method. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35449> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com