Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1c0f307

Browse files
authored
Merge pull request#1474 from Predeactor/master
Fix incomplete typehinting for PathLike
2 parentsf23994e +2303971 commit1c0f307

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

‎AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ Contributors are:
4646
-Robert Westman <robert _at_ byteflux.io>
4747
-Hugo van Kemenade
4848
-Hiroki Tokunaga <tokusan441 _at_ gmail.com>
49+
-Julien Mauroy <pro.julien.mauroy _at_ gmail.com>
4950
Portions derived from other open source works and are clearly marked.

‎git/types.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@
66
importos
77
importsys
88
fromtypingimport (
9-
Callable,
109
Dict,
1110
NoReturn,
1211
Sequence,
1312
Tuple,
1413
Union,
1514
Any,
16-
Iterator,# noqa: F401
17-
NamedTuple,
1815
TYPE_CHECKING,
1916
TypeVar,
2017
)# noqa: F401
2118

2219
ifsys.version_info[:2]>= (3,8):
2320
fromtypingimport (
24-
Final,
2521
Literal,
2622
SupportsIndex,
2723
TypedDict,
@@ -30,7 +26,6 @@
3026
)# noqa: F401
3127
else:
3228
fromtyping_extensionsimport (
33-
Final,
3429
Literal,
3530
SupportsIndex,# noqa: F401
3631
TypedDict,
@@ -46,9 +41,9 @@
4641

4742
ifsys.version_info[:2]< (3,9):
4843
PathLike=Union[str,os.PathLike]
49-
elifsys.version_info[:2]>= (3,9):
44+
else:
5045
# os.PathLike only becomes subscriptable from Python 3.9 onwards
51-
PathLike=Union[str,os.PathLike]
46+
PathLike=Union[str,os.PathLike[str]]
5247

5348
ifTYPE_CHECKING:
5449
fromgit.repoimportRepo
@@ -92,8 +87,6 @@ def assert_never(inp: NoReturn, raise_error: bool = True, exc: Union[Exception,
9287
raiseValueError(f"An unhandled Literal ({inp}) in an if/else chain was found")
9388
else:
9489
raiseexc
95-
else:
96-
pass
9790

9891

9992
classFiles_TD(TypedDict):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp