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
The type of self is Any if you don't have an annotation -- all unannotated arguments are given Any types. However, maybe self should be an exception and work similarly to annotated functions. The cls argument of class methods is also currently Any in unannotated methods even when using --check-unyped-defs.
Hmm, yeah, I think that'd make sense, in the same way that self gets assigned the correct type (Foo) when the method has just a return type annotation (def m(self) -> None:)
Activity
JukkaL commentedon Feb 26, 2018
The type of
selfisAnyif you don't have an annotation -- all unannotated arguments are givenAnytypes. However, maybeselfshould be an exception and work similarly to annotated functions. Theclsargument of class methods is also currentlyAnyin unannotated methods even when using--check-unyped-defs.gsalgado commentedon Feb 26, 2018
Hmm, yeah, I think that'd make sense, in the same way that
selfgets assigned the correct type (Foo) when the method has just a return type annotation (def m(self) -> None:)gvanrossum commentedon Feb 26, 2018
[-]Method body not checked even with --check-untyped-defs[/-][+]Better type for self in untyped functions[/+]Give self argument the correct type when using check_untyped_defs (#7530