fix(autoaliasattr): search for type aliases under if TYPE_CHECKING #3671
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
After #3668 was merged, the module level attributes of
manim.mobject.mobject
weren't shownAs you can see, this PR fixes that.
Previously, the directive wouldn't find stuff like
Edge Cases
Please note that these edge cases are unlikely to happen, and are only mentioned for completeness.
TYPE_CHECKING variable
The following will pass the initial filter (it will have to look through the whole body instead of skipping the
If
node)This is just a performance thing and not something that can be easily resolved (it's perfectly valid from a Syntax Tree's point of view)
typing.TYPE_CHECKING
The second is this case. I opted to be more specific and only limit it to
typing.TYPE_CHECKING
. Ifthere is a consensus to allow the following, it's a one line fix.
The same edge case as above applies, that is that the following will also have to go through the whole
If
node: