Hi, I think there is no way to document for parallel assigned attributes. Please write each attribute documentation in separated lines.
Technically: sphinx.pycode.AttrDocVisitor.add_docstring function interpret a attribute documentation. IF block at line 146 invoked only when `self.variable = value` style line placed before/after a doc-comment. https://bitbucket.org/birkenfeld/sphinx/src/ba4b069e/sphinx/pycode/__init__.py#cl-146 Regards, -- Takayuki SHIMIZUKAWA http://about.me/shimizukawa 2014-06-02 4:40 GMT+09:00 Buken Li <[email protected]>: > > <http://stackoverflow.com/questions/23981852/autoattribute-for-parallel-assignment-sphinx-doc#> > > When documenting instance variables, I can do > > class Foo: > def __init__(self): > self.spam = 4 > """Docstring for instance attribute spam.""" > > This doesn't work for parallel assignment > > class Foo: > def __init__(self): > self.spam, self.bar, self.moo = 4, 5, 6 > """Docstring for instance attribute spam.""" > > Is there any way I can document variables when using parallel assignment? > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sphinx-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
