-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parsing of nested classes #176
base: master
Are you sure you want to change the base?
Conversation
* Parse nested classes and present them in the class list * Changes _pep224_docstrings to use Doc.source instead of inspect to keep it DRY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking maybe we should actually make this the default (i.e. change Module.classes()
directly). Classes are classes, not variables, and if they are exposed and meant to be used (they should probably not be nested), they better be documented thoroughly.
This also needs a unit test in pdoc.test.__init__
.
try: | ||
tree = ast.parse(inspect.getsource(doc_obj.obj)) | ||
tree = ast.parse(source) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense, but could you merge the two into the same error. ast.parse()
surely throws something on an empty string or a None derived from empty_string or None
?
Hi, thanks for considering this. I can make the requested changes and add the test maybe from Monday. I am just sending so that you know I haven't just dropped this here and left :-). Cheers, |
No hurry, but this would sure make a nice addition! 😃 |
456869b
to
94d26e8
Compare
Nested classes are incorrectly parsed as class variables. This commit fixes that and adds a method
all_classes
inModule
that returns even the nested classes.Thanks,
Angelos