Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upInstance variables set using __pdoc__ don't work #107
Comments
This comment has been minimized.
This comment has been minimized.
|
Instance variables are detected by parsing the AST. I'd prefer a lower tech solution. You must write each instance variable on its own line, or modify |
This comment has been minimized.
This comment has been minimized.
|
Okay, thanks. I'm trying to work out how to do the latter; nothing I try is working. From the example above, would I do this? __pdoc__ = {}
__pdoc__['Foo.d'] = "Docstring for Foo's d instance variable."
class Foo:
a,b,c = 0, 1, 2
def __init__(self):
self.d, self.e, self.f = 3, 4, 5or |
This comment has been minimized.
This comment has been minimized.
So It looks like your example doesn't work, which means this is probably a bug. It looks like putting each instance variable on its own line does work though. |
This comment has been minimized.
This comment has been minimized.
|
Thanks. Shall I file a bug for that related-but-separate issue? |
BurntSushi
changed the title
Instance variables on multiple-assignment lines don't get exported
Instance variables set using __pdoc__ don't work
Jun 2, 2016
This comment has been minimized.
This comment has been minimized.
|
This issue is fine. I renamed the title. I don't think I'll ever support multiple instance variables defined on the same line. |
This comment has been minimized.
This comment has been minimized.
DewaldDeJager
commented
Apr 30, 2017
|
+1 for adding support for multiple instance variables defined on the same line. Wanted to see if there wasn't an issue on this already before opening one. My use case: (self.var1, self.var2, self.var3) = self.method_that_returns_tuple()Hopefully in future I can get some time and submit a pull request with this added. Thanks for the great tool, Andrew! |
JPLeBreton commentedMay 27, 2016
•
edited
If I have something like:
Class variables a,b,c show up in the generated docs, but instance variables d,e,f do not.
Expected result: instance variables declared in this manner should show up in generated docs.