-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
Never
annotations when merging pyi files.
`Never` is a valid type annotation, but it's most likely wrong if it's inferred by pytype, and it has a chain effect that all downstream code starts to get treated as unreachable. Fixing pytype to not infer `Never` on return types should be better, but this should be dealt as a separate fix. PiperOrigin-RevId: 684355324
- Loading branch information
1 parent
a370f22
commit 65ad8fb
Showing
4 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
def f() -> int: | ||
return 1 | ||
|
||
# The Never type in pyi file should not be merged here. | ||
def g(): | ||
raise Exception("hi") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
def f(): | ||
return 1 | ||
|
||
# The Never type in pyi file should not be merged here. | ||
def g(): | ||
raise Exception("hi") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
from typings import Never | ||
|
||
def f() -> int: ... | ||
def g() -> Never: ... |