-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suppress
unsubscriptable-object
warnings in type-checking blocks (#…
…5720) * Add a regression test for issue #3979 * Don't emit `unsubscriptable-object` for statements in type-checking blocks Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
- Loading branch information
1 parent
135477a
commit ec2eee8
Showing
4 changed files
with
28 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
Regression test for https://github.com/PyCQA/pylint/issues/3979 | ||
""" | ||
|
||
import os | ||
from typing import TYPE_CHECKING, Any, Union | ||
|
||
if TYPE_CHECKING: | ||
BasePathLike = os.PathLike[Any] # <-- pylint used to emit E1136 here | ||
else: | ||
BasePathLike = os.PathLike | ||
|
||
foo: Union[str, BasePathLike] = "bar" |