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
'foo' is just a placeholder in the below example; in the real code it is a file path that is passed through get_or_compute to the compute function and used as a cache key.
I would use the pytype equivalent of mypy's --no-warn-return-any to silence this kind of warning, but it seems like it's supposed to be opt-in in the first place (--no-return-any).
$ python repr.py
computing int
computing str
int: 1 str: 'a'
int: 1 str: 'a'
$ mypy --strict --no-warn-return-any repr.py
Success: no issues found in 1 source file
$ pytype-single repr.py
repr.py:19:9: error: in get_or_compute: bad option 'int' in return type [bad-return-type]
Expected: str
Actually returned: Any
return entry[key]
~~~~~~~~~~~~~~~~~
Called from (traceback):
line 37, in current file
line 32, in get_str
For more details, see https://google.github.io/pytype/errors.html#bad-return-type
The text was updated successfully, but these errors were encountered:
Description
I am using pytype 2024.10.11.
'foo' is just a placeholder in the below example; in the real code it is a file path that is passed through get_or_compute to the compute function and used as a cache key.
I would use the pytype equivalent of mypy's --no-warn-return-any to silence this kind of warning, but it seems like it's supposed to be opt-in in the first place (--no-return-any).
Possibly related (similar error): #1686 (comment)
Example Code
Steps to Reproduce
The text was updated successfully, but these errors were encountered: