-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix None
assignments with fine-grained cache
#11574
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
Fix None
assignments with fine-grained cache
#11574
Conversation
Problem: When using the fine-grained cache, we raise an assertion in some situations when an attribute is defined as `None`. Solution: Remove truthiness check to ensure that `None` is an allowed type. Fixes: python#8682 Fixes: python#11456
Related: #11561 Similar problem. |
Take a look at |
Thanks! I was able to add a test, repro the crash in I think this is good to go. ✅ |
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.
Thanks, awesome work narrowing this down.
I don't know all the cases when lvalue.node.type is None
and I'm not really familiar with the fine grained stuff. That is, I'm not sure I understand exactly what we should return here, e.g. returning UninhabitedType()
instead of NoneType()
also fixes the crash
This comment has been minimized.
This comment has been minimized.
Is this preferable? I don't have an opinion either way, so whichever is more likely to be merged works for me. |
Reading through the code, I think it doesn't make a practical difference, since Thanks again, tricky issue to narrow down! |
Sounds good to me, thank you! |
Problem: When using the fine-grained cache, we raise an assertion in some situations when an attribute is defined as `None`. Solution: Remove truthiness check to ensure that `None` is an allowed type. Fixes: python#8682 Fixes: python#11456
Description
Problem: When using the fine-grained cache, we raise an assertion in
some situations when an attribute is defined as
None
.Solution: Remove truthiness check to ensure that
None
is an allowedtype.
Fixes: #8682
Fixes: #11456
Test Plan
I've added a test that crashes in
master
and passes when this patch is applied.cc: @sobolevn