File tree 3 files changed +15
-5
lines changed
tests/stubtest_allowlists 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,13 @@ altsep: str
48
48
if sys .version_info < (3 , 7 ) and sys .platform == "win32" :
49
49
def splitunc (p : AnyStr ) -> tuple [AnyStr , AnyStr ]: ... # deprecated
50
50
51
- # Similar to posixpath, but have slightly different argument names
51
+ # First parameter is not actually pos-only,
52
+ # but must be defined as pos-only in the stub or cross-platform code doesn't type-check,
53
+ # as the parameter name is different in posixpath.join()
52
54
@overload
53
- def join (path : StrPath , * paths : StrPath ) -> str : ...
55
+ def join (__path : StrPath , * paths : StrPath ) -> str : ...
54
56
@overload
55
- def join (path : BytesPath , * paths : BytesPath ) -> bytes : ...
57
+ def join (__path : BytesPath , * paths : BytesPath ) -> bytes : ...
56
58
57
59
if sys .platform == "win32" :
58
60
if sys .version_info >= (3 , 10 ):
Original file line number Diff line number Diff line change @@ -60,10 +60,14 @@ def normpath(path: AnyStr) -> AnyStr: ...
60
60
def commonpath (paths : Sequence [StrPath ]) -> str : ...
61
61
@overload
62
62
def commonpath (paths : Sequence [BytesPath ]) -> bytes : ...
63
+
64
+ # First parameter is not actually pos-only,
65
+ # but must be defined as pos-only in the stub or cross-platform code doesn't type-check,
66
+ # as the parameter name is different in ntpath.join()
63
67
@overload
64
- def join (a : StrPath , * paths : StrPath ) -> str : ...
68
+ def join (__a : StrPath , * paths : StrPath ) -> str : ...
65
69
@overload
66
- def join (a : BytesPath , * paths : BytesPath ) -> bytes : ...
70
+ def join (__a : BytesPath , * paths : BytesPath ) -> bytes : ...
67
71
68
72
if sys .version_info >= (3 , 10 ):
69
73
@overload
Original file line number Diff line number Diff line change @@ -115,6 +115,10 @@ contextlib.AbstractContextManager.__exit__
115
115
io.IncrementalNewlineDecoder.setstate
116
116
typing.SupportsRound.__round__
117
117
types.DynamicClassAttribute..* # In the stub we pretend it's an alias for property, but it has positional-only differences
118
+ # These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812
119
+ posixpath.join
120
+ ntpath.join
121
+ os.path.join
118
122
119
123
# These enums derive from (str, Enum). See comment in py3_common.txt
120
124
pstats.SortKey.__new__
You can’t perform that action at this time.
0 commit comments