-
-
Couldn't load subscription status.
- Fork 3k
Discard partials remaining after inference failure #20126
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
Discard partials remaining after inference failure #20126
Conversation
This comment has been minimized.
This comment has been minimized.
|
All primer hits are correct - empty list in sympy, |
|
(cc @JukkaL - you recently authored |
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 this is actually the correct fix (unless @JukkaL disagrees), I however have a suggestion on the fallback behavior.
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.
LG, couple more comments.
This comment has been minimized.
This comment has been minimized.
|
Diff from mypy_primer, showing the effect of this PR on open source code: mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ pymongo/synchronous/topology.py:114: error: Need type annotation for "_events" [var-annotated]
+ pymongo/synchronous/topology.py:129: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_opened" [union-attr]
+ pymongo/synchronous/topology.py:148: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_description_changed" [union-attr]
+ pymongo/synchronous/topology.py:164: error: Item "None" of "_EventListeners | None" has no attribute "publish_server_opened" [union-attr]
+ pymongo/synchronous/topology.py:496: error: Item "None" of "_EventListeners | None" has no attribute "publish_server_description_changed" [union-attr]
+ pymongo/synchronous/topology.py:508: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_description_changed" [union-attr]
+ pymongo/synchronous/topology.py:575: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_description_changed" [union-attr]
+ pymongo/synchronous/topology.py:734: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_description_changed" [union-attr]
+ pymongo/synchronous/topology.py:742: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_closed" [union-attr]
+ pymongo/asynchronous/topology.py:114: error: Need type annotation for "_events" [var-annotated]
+ pymongo/asynchronous/topology.py:129: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_opened" [union-attr]
+ pymongo/asynchronous/topology.py:148: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_description_changed" [union-attr]
+ pymongo/asynchronous/topology.py:164: error: Item "None" of "_EventListeners | None" has no attribute "publish_server_opened" [union-attr]
+ pymongo/asynchronous/topology.py:496: error: Item "None" of "_EventListeners | None" has no attribute "publish_server_description_changed" [union-attr]
+ pymongo/asynchronous/topology.py:508: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_description_changed" [union-attr]
+ pymongo/asynchronous/topology.py:575: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_description_changed" [union-attr]
+ pymongo/asynchronous/topology.py:736: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_description_changed" [union-attr]
+ pymongo/asynchronous/topology.py:744: error: Item "None" of "_EventListeners | None" has no attribute "publish_topology_closed" [union-attr]
sympy (https://github.com/sympy/sympy)
+ sympy/core/add.py:218: error: Need type annotation for "rv" [var-annotated]
|
Fixes #16573.
Fixes #3031.
When we infer something with Never as a replacement for a partial type, we cannot ignore that result entirely: if we do that, any use of that variable down the road will still refer to
partial<None>, causing reachability issues and unexpected partials leaks.