Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add parsing of nested classes #176

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

Open
angeloskath wants to merge 1 commit into pdoc3:master
base: master
Choose a base branch
Loading
from angeloskath:nested-classes

Conversation

Copy link

@angeloskath angeloskath commented Mar 29, 2020

Nested classes are incorrectly parsed as class variables. This commit fixes that and adds a method all_classes in Module that returns even the nested classes.

Thanks,
Angelos

JPHutchins reacted with thumbs up emoji
* Parse nested classes and present them in the class list
* Changes _pep224_docstrings to use Doc.source instead of inspect to keep it
 DRY
Copy link
Member

@kernc kernc left a 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)
Copy link
Member

@kernc kernc Apr 11, 2020
edited
Loading

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?

@kernc kernc added enhancement New feature or request help wanted 🤷 Extra attention is needed labels Apr 16, 2020
Copy link
Author

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,
Angelos

kernc reacted with heart emoji

Copy link
Member

kernc commented Jun 1, 2020

No hurry, but this would sure make a nice addition! 😃

Copy link
Contributor

frank101010 commented Mar 30, 2022
edited
Loading

Pull request #390 contains most of angeloskath's changes, but based on pdoc3, commit 2cce30a (March 2022).

(deleted section about unit test problems, which were resolved after running tests on an os supporting symbolic links)

@kernc kernc force-pushed the master branch 3 times, most recently from 456869b to 94d26e8 Compare June 25, 2024 20:37
@kernc kernc force-pushed the master branch 6 times, most recently from 31bff05 to 0bcb40f Compare June 30, 2025 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@kernc kernc kernc requested changes

Assignees
No one assigned
Labels
enhancement New feature or request help wanted 🤷 Extra attention is needed
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /