-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Labels
pytorchscoping-control-flowissues related to scoping and control flowissues related to scoping and control flow
Description
Describe the Bug
from typing import *
class Foo:
autogrids: None | dict[str, Any]
def f(self, xs: list[int]):
self.autogrids = {}
for a in []:
self.autogrids["test"] = True # E: ERROR 9:13-35: Cannot set item in `None`We should remember that autogrids is always going to be a dict at this point.
Sandbox Link
(Only applicable for extension issues) IDE Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
pytorchscoping-control-flowissues related to scoping and control flowissues related to scoping and control flow