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

Commitf8195bc

Browse files
Sync typeshed (#17772)
Source commit:python/typeshed@9e506eb
1 parent72c413d commitf8195bc

File tree

16 files changed

+214
-106
lines changed

16 files changed

+214
-106
lines changed

‎mypy/typeshed/stdlib/VERSIONS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ _json: 3.0-
4141
_locale: 3.0-
4242
_lsprof: 3.0-
4343
_markupbase: 3.0-
44-
_msi: 3.0-
44+
_msi: 3.0-3.12
4545
_operator: 3.4-
4646
_osx_support: 3.0-
4747
_posixsubprocess: 3.2-

‎mypy/typeshed/stdlib/_curses.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ class _CursesWindow:
493493
definstr(self,y:int,x:int,n:int= ...)->bytes: ...
494494
defis_linetouched(self,line:int,/)->bool: ...
495495
defis_wintouched(self)->bool: ...
496-
defkeypad(self,yes:bool)->None: ...
496+
defkeypad(self,yes:bool,/)->None: ...
497497
defleaveok(self,yes:bool)->None: ...
498498
defmove(self,new_y:int,new_x:int)->None: ...
499499
defmvderwin(self,y:int,x:int)->None: ...

‎mypy/typeshed/stdlib/_locale.pyi‎

Lines changed: 85 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
11
importsys
22
from_typeshedimportStrPath
3-
fromcollections.abcimportMapping
3+
fromtypingimportFinal,Literal,TypedDict,type_check_only
44

5-
LC_CTYPE:int
6-
LC_COLLATE:int
7-
LC_TIME:int
8-
LC_MONETARY:int
9-
LC_NUMERIC:int
10-
LC_ALL:int
11-
CHAR_MAX:int
5+
@type_check_only
6+
class_LocaleConv(TypedDict):
7+
decimal_point:str
8+
grouping:list[int]
9+
thousands_sep:str
10+
int_curr_symbol:str
11+
currency_symbol:str
12+
p_cs_precedes:Literal[0,1,127]
13+
n_cs_precedes:Literal[0,1,127]
14+
p_sep_by_space:Literal[0,1,127]
15+
n_sep_by_space:Literal[0,1,127]
16+
mon_decimal_point:str
17+
frac_digits:int
18+
int_frac_digits:int
19+
mon_thousands_sep:str
20+
mon_grouping:list[int]
21+
positive_sign:str
22+
negative_sign:str
23+
p_sign_posn:Literal[0,1,2,3,4,127]
24+
n_sign_posn:Literal[0,1,2,3,4,127]
25+
26+
LC_CTYPE:Final[int]
27+
LC_COLLATE:Final[int]
28+
LC_TIME:Final[int]
29+
LC_MONETARY:Final[int]
30+
LC_NUMERIC:Final[int]
31+
LC_ALL:Final[int]
32+
CHAR_MAX:Final=127
1233

1334
defsetlocale(category:int,locale:str|None=None,/)->str: ...
14-
deflocaleconv()->Mapping[str,int|str|list[int]]: ...
35+
deflocaleconv()->_LocaleConv: ...
1536

1637
ifsys.version_info>= (3,11):
1738
defgetencoding()->str: ...
@@ -25,67 +46,67 @@ def strxfrm(string: str, /) -> str: ...
2546
ifsys.platform!="win32":
2647
LC_MESSAGES:int
2748

28-
ABDAY_1:int
29-
ABDAY_2:int
30-
ABDAY_3:int
31-
ABDAY_4:int
32-
ABDAY_5:int
33-
ABDAY_6:int
34-
ABDAY_7:int
49+
ABDAY_1:Final[int]
50+
ABDAY_2:Final[int]
51+
ABDAY_3:Final[int]
52+
ABDAY_4:Final[int]
53+
ABDAY_5:Final[int]
54+
ABDAY_6:Final[int]
55+
ABDAY_7:Final[int]
3556

36-
ABMON_1:int
37-
ABMON_2:int
38-
ABMON_3:int
39-
ABMON_4:int
40-
ABMON_5:int
41-
ABMON_6:int
42-
ABMON_7:int
43-
ABMON_8:int
44-
ABMON_9:int
45-
ABMON_10:int
46-
ABMON_11:int
47-
ABMON_12:int
57+
ABMON_1:Final[int]
58+
ABMON_2:Final[int]
59+
ABMON_3:Final[int]
60+
ABMON_4:Final[int]
61+
ABMON_5:Final[int]
62+
ABMON_6:Final[int]
63+
ABMON_7:Final[int]
64+
ABMON_8:Final[int]
65+
ABMON_9:Final[int]
66+
ABMON_10:Final[int]
67+
ABMON_11:Final[int]
68+
ABMON_12:Final[int]
4869

49-
DAY_1:int
50-
DAY_2:int
51-
DAY_3:int
52-
DAY_4:int
53-
DAY_5:int
54-
DAY_6:int
55-
DAY_7:int
70+
DAY_1:Final[int]
71+
DAY_2:Final[int]
72+
DAY_3:Final[int]
73+
DAY_4:Final[int]
74+
DAY_5:Final[int]
75+
DAY_6:Final[int]
76+
DAY_7:Final[int]
5677

57-
ERA:int
58-
ERA_D_T_FMT:int
59-
ERA_D_FMT:int
60-
ERA_T_FMT:int
78+
ERA:Final[int]
79+
ERA_D_T_FMT:Final[int]
80+
ERA_D_FMT:Final[int]
81+
ERA_T_FMT:Final[int]
6182

62-
MON_1:int
63-
MON_2:int
64-
MON_3:int
65-
MON_4:int
66-
MON_5:int
67-
MON_6:int
68-
MON_7:int
69-
MON_8:int
70-
MON_9:int
71-
MON_10:int
72-
MON_11:int
73-
MON_12:int
83+
MON_1:Final[int]
84+
MON_2:Final[int]
85+
MON_3:Final[int]
86+
MON_4:Final[int]
87+
MON_5:Final[int]
88+
MON_6:Final[int]
89+
MON_7:Final[int]
90+
MON_8:Final[int]
91+
MON_9:Final[int]
92+
MON_10:Final[int]
93+
MON_11:Final[int]
94+
MON_12:Final[int]
7495

75-
CODESET:int
76-
D_T_FMT:int
77-
D_FMT:int
78-
T_FMT:int
79-
T_FMT_AMPM:int
80-
AM_STR:int
81-
PM_STR:int
96+
CODESET:Final[int]
97+
D_T_FMT:Final[int]
98+
D_FMT:Final[int]
99+
T_FMT:Final[int]
100+
T_FMT_AMPM:Final[int]
101+
AM_STR:Final[int]
102+
PM_STR:Final[int]
82103

83-
RADIXCHAR:int
84-
THOUSEP:int
85-
YESEXPR:int
86-
NOEXPR:int
87-
CRNCYSTR:int
88-
ALT_DIGITS:int
104+
RADIXCHAR:Final[int]
105+
THOUSEP:Final[int]
106+
YESEXPR:Final[int]
107+
NOEXPR:Final[int]
108+
CRNCYSTR:Final[int]
109+
ALT_DIGITS:Final[int]
89110

90111
defnl_langinfo(key:int,/)->str: ...
91112

‎mypy/typeshed/stdlib/_winapi.pyi‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,20 @@ if sys.platform == "win32":
9999
SEC_RESERVE:Final=0x4000000
100100
SEC_WRITECOMBINE:Final=0x40000000
101101

102+
ifsys.version_info>= (3,13):
103+
STARTF_FORCEOFFFEEDBACK:Final=0x80
104+
STARTF_FORCEONFEEDBACK:Final=0x40
105+
STARTF_PREVENTPINNING:Final=0x2000
106+
STARTF_RUNFULLSCREEN:Final=0x20
107+
STARTF_TITLEISAPPID:Final=0x1000
108+
STARTF_TITLEISLINKNAME:Final=0x800
109+
STARTF_UNTRUSTEDSOURCE:Final=0x8000
110+
STARTF_USECOUNTCHARS:Final=0x8
111+
STARTF_USEFILLATTRIBUTE:Final=0x10
112+
STARTF_USEHOTKEY:Final=0x200
113+
STARTF_USEPOSITION:Final=0x4
114+
STARTF_USESIZE:Final=0x2
115+
102116
STARTF_USESHOWWINDOW:Final=0x1
103117
STARTF_USESTDHANDLES:Final=0x100
104118

@@ -250,6 +264,20 @@ if sys.platform == "win32":
250264
defcancel(self)->None: ...
251265
defgetbuffer(self)->bytes|None: ...
252266

267+
ifsys.version_info>= (3,13):
268+
defBatchedWaitForMultipleObjects(
269+
handle_seq:Sequence[int],wait_all:bool,milliseconds:int=0xFFFFFFFF
270+
)->list[int]: ...
271+
defCreateEventW(security_attributes:int,manual_reset:bool,initial_state:bool,name:str|None)->int: ...
272+
defCreateMutexW(security_attributes:int,initial_owner:bool,name:str)->int: ...
273+
defGetLongPathName(path:str)->str: ...
274+
defGetShortPathName(path:str)->str: ...
275+
defOpenEventW(desired_access:int,inherit_handle:bool,name:str)->int: ...
276+
defOpenMutexW(desired_access:int,inherit_handle:bool,name:str)->int: ...
277+
defReleaseMutex(mutex:int)->None: ...
278+
defResetEvent(event:int)->None: ...
279+
defSetEvent(event:int)->None: ...
280+
253281
ifsys.version_info>= (3,12):
254282
defCopyFile2(existing_file_name:str,new_file_name:str,flags:int,progress_routine:int|None=None)->int: ...
255283
defNeedCurrentDirectoryForExePath(exe_name:str,/)->bool: ...

‎mypy/typeshed/stdlib/builtins.pyi‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa: PYI036 # This is the module declaring BaseException
12
import_ast
23
import_typeshed
34
importsys

‎mypy/typeshed/stdlib/codecs.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class _Encoder(Protocol):
8080
def__call__(self,input:str,errors:str= ...,/)->tuple[bytes,int]: ...# signature of Codec().encode
8181

8282
class_Decoder(Protocol):
83-
def__call__(self,input:bytes,errors:str= ...,/)->tuple[str,int]: ...# signature of Codec().decode
83+
def__call__(self,input:ReadableBuffer,errors:str= ...,/)->tuple[str,int]: ...# signature of Codec().decode
8484

8585
class_StreamReader(Protocol):
8686
def__call__(self,stream:_ReadableStream,errors:str= ...,/)->StreamReader: ...

‎mypy/typeshed/stdlib/copy.pyi‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
importsys
22
fromtypingimportAny,Protocol,TypeVar
3-
fromtyping_extensionsimportParamSpec,Self
3+
fromtyping_extensionsimportSelf
44

55
__all__= ["Error","copy","deepcopy"]
66

77
_T=TypeVar("_T")
8-
_SR=TypeVar("_SR",bound=_SupportsReplace[Any])
9-
_P=ParamSpec("_P")
8+
_SR=TypeVar("_SR",bound=_SupportsReplace)
109

11-
class_SupportsReplace(Protocol[_P]):
10+
class_SupportsReplace(Protocol):
1211
# In reality doesn't support args, but there's no other great way to express this.
13-
def__replace__(self,*args:_P.args,**kwargs:_P.kwargs)->Self: ...
12+
def__replace__(self,*args:Any,**kwargs:Any)->Self: ...
1413

1514
# None in CPython but non-None in Jython
1615
PyStringMap:Any

‎mypy/typeshed/stdlib/distutils/dist.pyi‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class Distribution:
270270
defhas_data_files(self)->bool: ...
271271
defis_pure(self)->bool: ...
272272

273-
#Gettermethods generated in __init__
273+
#Default gettermethods generated in __init__ from self.metadata._METHOD_BASENAMES
274274
defget_name(self)->str: ...
275275
defget_version(self)->str: ...
276276
defget_fullname(self)->str: ...
@@ -292,3 +292,26 @@ class Distribution:
292292
defget_requires(self)->list[str]: ...
293293
defget_provides(self)->list[str]: ...
294294
defget_obsoletes(self)->list[str]: ...
295+
296+
# Default attributes generated in __init__ from self.display_option_names
297+
help_commands:bool|Literal[0]
298+
name:str|Literal[0]
299+
version:str|Literal[0]
300+
fullname:str|Literal[0]
301+
author:str|Literal[0]
302+
author_email:str|Literal[0]
303+
maintainer:str|Literal[0]
304+
maintainer_email:str|Literal[0]
305+
contact:str|Literal[0]
306+
contact_email:str|Literal[0]
307+
url:str|Literal[0]
308+
license:str|Literal[0]
309+
licence:str|Literal[0]
310+
description:str|Literal[0]
311+
long_description:str|Literal[0]
312+
platforms:str|list[str]|Literal[0]
313+
classifiers:str|list[str]|Literal[0]
314+
keywords:str|list[str]|Literal[0]
315+
provides:list[str]|Literal[0]
316+
requires:list[str]|Literal[0]
317+
obsoletes:list[str]|Literal[0]

‎mypy/typeshed/stdlib/doctest.pyi‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
importsys
12
importtypes
23
importunittest
34
from_typeshedimportExcInfo
45
fromcollections.abcimportCallable
5-
fromtypingimportAny,NamedTuple
6-
fromtyping_extensionsimportTypeAlias
6+
fromtypingimportAny,ClassVar,NamedTuple
7+
fromtyping_extensionsimportSelf,TypeAlias
78

89
__all__= [
910
"register_optionflag",
@@ -41,9 +42,22 @@ __all__ = [
4142
"debug",
4243
]
4344

44-
classTestResults(NamedTuple):
45-
failed:int
46-
attempted:int
45+
# MyPy errors on conditionals within named tuples.
46+
47+
ifsys.version_info>= (3,13):
48+
classTestResults(NamedTuple):
49+
def__new__(cls,failed:int,attempted:int,*,skipped:int=0)->Self: ...# type: ignore[misc]
50+
skipped:int
51+
failed:int
52+
attempted:int
53+
_fields:ClassVar= ("failed","attempted")# type: ignore[misc]
54+
__match_args__= ("failed","attempted")# type: ignore[misc]
55+
__doc__:None# type: ignore[misc]
56+
57+
else:
58+
classTestResults(NamedTuple):
59+
failed:int
60+
attempted:int
4761

4862
OPTIONFLAGS_BY_NAME:dict[str,int]
4963

@@ -134,6 +148,8 @@ class DocTestRunner:
134148
original_optionflags:int
135149
tries:int
136150
failures:int
151+
ifsys.version_info>= (3,13):
152+
skips:int
137153
test:DocTest
138154
def__init__(self,checker:OutputChecker|None=None,verbose:bool|None=None,optionflags:int=0)->None: ...
139155
defreport_start(self,out:_Out,test:DocTest,example:Example)->None: ...

‎mypy/typeshed/stdlib/email/_header_value_parser.pyi‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ TOKEN_ENDS: Final[set[str]]
1616
ASPECIALS:Final[set[str]]
1717
ATTRIBUTE_ENDS:Final[set[str]]
1818
EXTENDED_ATTRIBUTE_ENDS:Final[set[str]]
19+
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
20+
NLSET:Final[set[str]]
21+
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
22+
SPECIALSNL:Final[set[str]]
1923

2024
defquote_string(value:Any)->str: ...
2125

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp