-
Notifications
You must be signed in to change notification settings - Fork 49
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 'If' condition evaluation feature based on user input #590
base: master
Are you sure you want to change the base?
Conversation
…re. The older visitor relied on generic_visit() to be recursive. Where the provided generic_visit() is not recursive anymore, and moreover not called automatically when visiting unknow nodes! So what I'm saying here is that since #576 have been merged, we're not visiting the statements inside the 'orelse' field of Try and If nodes, same goes for 'finalbody' and 'handlers'. This commit fixes that issue. The rationale is now the following: All statements in the 'orelse' block of IF nodes and statements in the except handlers of TRY nodes that would override a name already defined in the main 'body' (or TRY 'orelse' or 'finalbody') are ignored. Meaning that in the context of the code below, 'ssl' would resolve to 'twisted.internet.ssl': try: from twisted.internet import ssl as _ssl except ImportError: ssl = None else: ssl = _ssl
Properly add support for that to override_guard() function instead.
…:twisted/pydoctor into visit-try-orelse-finalbody-and-if-orelse
…YPE_CHECKING-value-for-a-module
Codecov Report
@@ Coverage Diff @@
## master #590 +/- ##
==========================================
+ Coverage 90.92% 91.01% +0.09%
==========================================
Files 45 45
Lines 7699 7777 +78
Branches 1668 1693 +25
==========================================
+ Hits 7000 7078 +78
Misses 435 435
Partials 264 264
Continue to review full report at Codecov.
|
Should this feature be a proper option or it should stay a system class variable to override ? It's likely that other projects will need the same kind of adjustments as Klein, so maybe it should. |
Fixes #174.
Marked as draft until #589 is merged.
Documentation: https://pydoctor--590.org.readthedocs.build/en/590/customize.html#tweak-ifs-branch-priority