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
Support for nested classes and function for pyclbr #50940
Comments
I have worked on a patch for adding support for nested classes and The patch attached also contains a test and updated documentation. |
Patch tested ok against 2.7 on windows vista. Patch seems clean to me, can we get this committed please. |
Too late for version 2. I updated patch for 3.2, and tried to improve the documentation a little bit. |
Looking at the code, there are several references to nested classes, implying that they should already work. So I might want to claim this is a behavior issue, contrary to my adding 'enhancement' before. But moot point until patch is reviewed and otherwise ready to merge. And 3.7 would be better than never. The patch does have a new test. |
I'm working on a PR for this. It passed the existing test cases, but then I tried something that didn't pass, so I'm working on fixing that. |
I would like to get this in 3.7.0a1, scheduled for 2017 Sept 9, and subsequently in 3.6.3. Cheryl, this is why I distracted you from the configdialog patch. As a non-idlelib patch, more discussion by more people may be needed before a merge. If this is not backported to 3.6 Lib/pyclbr, I will backport it to 3.6, maybe as Lib/idlelib/_pyclbr, or maybe as a direct addition to browser.py, replacing the import statement. |
I have the change ready to push. I didn't change the tests, except to fix what was failing earlier, so the tests would need to be reviewed (the test currently creates a real temporary file that it opened and read, but a Mock would be better?) Anyway, do you want me to make the PR with what I have or would you rather a new diff file? |
PR. Also manually test classbrowser with the modified pyclbr and report what you see on your system. |
I've created the PR. I had actually manually looked at classbrowser yesterday. It still works just as it did before this change. The patch in 1612262 is needed for it to loop through the new Object class. Also, for reference, the test that didn't work initially was the case where anything was defined past the second level of nesting of a class, for example class -> def -> def or class -> def -> class. The original patch wasn't adding those last items, but now should be. Ironically, running this over test_pyclbr (to parse it, not to run the test), was where I saw that it wasn't showing all the nesting. |
Test_pyclbr could improve. There are notes on the PR for a new issue for that. If I find that further change is needed after applying to IDLE's module browser, bpo-1612262, that will be another new issue. |
Unlinked bogus revert message. I checked the file and it has the new function. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: