-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joshua Bronson schrieb: > I'd like to be able to associate a docstring with an instance > attribute in such a way that autodoc will discover it along with the > rest of the documentation for the class's properties, methods, and > class attributes. I went out on a limb and tried the following: > > class Foo: > def __init__(self): > #: i can haz instance attribute docstring? > self.bar = 1 > > but as I expected, it didn't work. I could make properties out of my > attributes just for this purpose, but of course I'd rather not have > to. > > Is there some way to do this? If not, would it be possible to add this > feature?
I think I will add it, since adding attributes in __init__ is a very common pattern. I've added http://bitbucket.org/birkenfeld/sphinx/issue/280/ so that I don't forget about it. :) cheers, Georg -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (GNU/Linux) iEYEARECAAYFAkr5JPsACgkQN9GcIYhpnLABmgCfe5dVtarG3QS9yX6S3HspUAeU qvIAoIJsP9b5gOMR1THWom3xMm4TSarK =c2pN -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en -~----------~----~----~----~------~----~------~--~---
