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
Mypy reports an error for method save1 (without annotation) but no errors for save2 and save3 (with different Self annotations), despite their (almost) identical function bodies:
fromcopyimportdeepcopyfromtypingimportSelfclassA:
states: list[Self]
defsave1(self) ->None:
self.states.append(deepcopy(self)) # error: Argument 1 to "append" of "list" has incompatible type "A"; expected "Self" [arg-type]defsave2(self: Self) ->None:
self.states.append(deepcopy(self))
defsave3(self) ->Self:
self.states.append(deepcopy(self))
returnself
This bug might be related to #15529 but is not fixed by #15541.
The content you are editing has changed. Please copy your edits and refresh the page.
Mypy reports an error for method
save1
(without annotation) but no errors forsave2
andsave3
(with different Self annotations), despite their (almost) identical function bodies:This bug might be related to #15529 but is not fixed by #15541.
Tasks
The text was updated successfully, but these errors were encountered: