-
-
Notifications
You must be signed in to change notification settings - Fork 292
Assert parent is not None #2110
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
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2110 +/- ##
=======================================
Coverage 92.75% 92.75%
=======================================
Files 94 94
Lines 11004 11005 +1
=======================================
+ Hits 10207 10208 +1
Misses 797 797
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should think about making this some sort of generic attribute of NodeNG
. There are lots of nodes where we know that parent
is not None
. Not having to put asserts everywhere would be much better, but I haven't had the time to look into how to do this properly.
When is it possible for there to be no parent? Just for modules? |
As far as assertions go, I think it's worth adding them if it helps getting Mypy running without errors. |
I think so, but also for nodes that are constructed out of thin air. We do that quite often.
I don't think so. Asserts change behaviour and can make |
The brains do this all over the place, see #1490 (comment). |
Type of Changes
Description
Fixes one Mypy error.