Skip to content

Commit 7f9a18d

Browse files
committed
conformance: allow emitting an error on missing return with Any annotation
Pycroscope produces an error on the existing open() function in this file because it is annotated as returning Any, but doesn't have a return statement. There's some existing discussion of this case in python/mypy#10297 showing that it is intentional for mypy to not error here, but I don't think we need to prohibit type checkers from emitting an error in this case if they choose.
1 parent 21b0785 commit 7f9a18d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

conformance/tests/literals_interactions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def open(path: _PathType, mode: str) -> IO[Any]:
4343

4444

4545
def open(path: _PathType, mode: Any) -> Any:
46-
pass
46+
raise NotImplementedError
4747

4848

4949
assert_type(open("path", "r"), IO[str])

0 commit comments

Comments
 (0)