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 flag will default to false and will be mandatory for all targets.
Eg:
thirdparty.pyi
deffoo(a: list[Any]) ->Any: ...
my.py
fromthirdpartyimportfooreveal_type(foo) # def (a: list[object]) -> objecta: int=foo([1]) # error: expression has type "object" variable has type "int"
I don't see any value in converting it to Untyped or showing an error that a parameter is typed as Any, how would you be able to do anything to fix it?
The text was updated successfully, but these errors were encountered:
@DetachHead After thinking about these kind of issues a bit I think this might not be the best resolution, but if you can provide some examples where this is based that would help me out a bit.
What about something more like:
third_party.foo(1) # call to function with `Any`third_party.bar=1# assignment to attribute with `Any`some_list=third_party.get_list() # error, return type contains anysome_list=cast(list[int], third_party.get_list()) # that's okaysome_list: list[int] =third_party.get_list() # that's okay
KotlinIsland
changed the title
A flag to treat third-party Any as object
A flag to treat third-party Any as object/UntypedApr 13, 2022
The flag will default to false and will be mandatory for all targets.
Eg:
thirdparty.pyi
my.py
I don't see any value in converting it to
Untyped
or showing an error that a parameter is typed asAny
, how would you be able to do anything to fix it?The text was updated successfully, but these errors were encountered: