-
Notifications
You must be signed in to change notification settings - Fork 53
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
Handle typing.Generic case in MRO #847
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #847 +/- ##
==========================================
- Coverage 92.85% 92.85% -0.01%
==========================================
Files 47 47
Lines 8528 8551 +23
Branches 1573 1578 +5
==========================================
+ Hits 7919 7940 +21
- Misses 348 349 +1
- Partials 261 262 +1 ☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is not the most correct implementation. Sorting the MRO is not the way to go. I’ll think about it more but we might have to refactor the whole MRO computing code… EDIT: this has been done |
…ould be adjustable for future tweaks like the one for typing.Generic.
…ng-Generic-in-MRO # Conflicts: # pydoctor/model.py
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Diff from pydoctor_primer, showing the effect of this PR on open source code: twisted (https://github.com/twisted/twisted)
- /projects/twisted/src/twisted/python/zippath.py:52: Cannot compute linearization of the class inheritance hierarchy
- /projects/twisted/src/twisted/python/zippath.py:261: Cannot compute linearization of the class inheritance hierarchy
|
@glyph This fixes a bug in pydoctor that affects the twisted codebase. It uses the graphlib module introduced in Python 3.9 to compute the class graph topological order, which should improve performance as well. |
Fix #846.
This should also speed-up the MRO processing since we now process all classes in topological order and use caching for predecessor MROs, avoiding to re-compute for every subclasses like the current code does.