You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
though this may be difficult to correctly fix. for example if we were to copy the current behavior pyright uses to check for assignments in __init__ it would also be incorrect:
classC:
x: int# no error, even though x is never assigneddef__init__(self) ->None:
ifbool():
self.x=3
i think we would need to analyze the flow to address this properly. i havent yet touched that part of the pyright codebase so i have no idea what the best way to do this would be, so maybe we can just keep the behavior you have for now and create a follow-up issue for this.
looks like this only works on top-level statements:
though this may be difficult to correctly fix. for example if we were to copy the current behavior pyright uses to check for assignments in
__init__
it would also be incorrect:i think we would need to analyze the flow to address this properly. i havent yet touched that part of the pyright codebase so i have no idea what the best way to do this would be, so maybe we can just keep the behavior you have for now and create a follow-up issue for this.
Originally posted by @DetachHead in #975 (comment)
The text was updated successfully, but these errors were encountered: