Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/distutils/fancy_getopt.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Iterable, List, Mapping, Optional, Tuple, overload
from typing import Any, Iterable, Mapping, Optional, Tuple, overload

_Option = Tuple[str, Optional[str], str]
_GR = Tuple[List[str], OptionDummy]
_GR = Tuple[list[str], OptionDummy]

def fancy_getopt(
options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None
Expand Down
4 changes: 2 additions & 2 deletions stdlib/email/_header_value_parser.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from email.errors import HeaderParseError, MessageDefect
from email.policy import Policy
from typing import Any, Iterable, Iterator, List, Pattern, Set, Tuple, Type, TypeVar, Union
from typing import Any, Iterable, Iterator, Pattern, Set, Tuple, Type, TypeVar, Union
from typing_extensions import Final

_T = TypeVar("_T")
Expand All @@ -23,7 +23,7 @@ def quote_string(value: Any) -> str: ...
if sys.version_info >= (3, 7):
rfc2047_matcher: Pattern[str]

class TokenList(List[Union[TokenList, Terminal]]):
class TokenList(list[Union[TokenList, Terminal]]):
token_type: str | None = ...
syntactic_break: bool = ...
ew_combine_allowed: bool = ...
Expand Down
4 changes: 2 additions & 2 deletions stdlib/email/message.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ from email.charset import Charset
from email.contentmanager import ContentManager
from email.errors import MessageDefect
from email.policy import Policy
from typing import Any, Generator, Iterator, List, Optional, Sequence, Tuple, TypeVar, Union
from typing import Any, Generator, Iterator, Optional, Sequence, Tuple, TypeVar, Union

_T = TypeVar("_T")

_PayloadType = Union[List[Message], str, bytes]
_PayloadType = Union[list[Message], str, bytes]
_CharsetType = Union[Charset, str, None]
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]]
Expand Down
4 changes: 2 additions & 2 deletions stdlib/lib2to3/pgen2/grammar.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from _typeshed import StrPath
from typing import Dict, List, Optional, Tuple, TypeVar
from typing import Dict, Optional, Tuple, TypeVar

_P = TypeVar("_P")
_Label = Tuple[int, Optional[str]]
_DFA = List[List[Tuple[int, int]]]
_DFA = list[list[Tuple[int, int]]]
_DFAS = Tuple[_DFA, Dict[int, int]]

class Grammar:
Expand Down
4 changes: 2 additions & 2 deletions stdlib/lib2to3/pytree.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from lib2to3.pgen2.grammar import Grammar
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, TypeVar, Union
from typing import Any, Callable, Dict, Iterator, Optional, Tuple, TypeVar, Union

_P = TypeVar("_P")
_NL = Union[Node, Leaf]
_Context = Tuple[str, int, int]
_Results = Dict[str, _NL]
_RawNode = Tuple[int, str, _Context, Optional[List[_NL]]]
_RawNode = Tuple[int, str, _Context, Optional[list[_NL]]]
_Convert = Callable[[Grammar, _RawNode], Any]

HUGE: int
Expand Down
4 changes: 2 additions & 2 deletions stdlib/msilib/sequence.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sys
from typing import List, Optional, Tuple
from typing import Optional, Tuple

if sys.platform == "win32":

_SequenceType = List[Tuple[str, Optional[str], int]]
_SequenceType = list[Tuple[str, Optional[str], int]]

AdminExecuteSequence: _SequenceType
AdminUISequence: _SequenceType
Expand Down
4 changes: 2 additions & 2 deletions stdlib/multiprocessing/pool.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from _typeshed import Self
from typing import Any, Callable, ContextManager, Generic, Iterable, Iterator, List, Mapping, TypeVar
from typing import Any, Callable, ContextManager, Generic, Iterable, Iterator, Mapping, TypeVar

if sys.version_info >= (3, 9):
from types import GenericAlias
Expand All @@ -26,7 +26,7 @@ class ApplyResult(Generic[_T]):
# alias created during issue #17805
AsyncResult = ApplyResult

class MapResult(ApplyResult[List[_T]]): ...
class MapResult(ApplyResult[list[_T]]): ...

class IMapIterator(Iterator[_T]):
def __iter__(self: _S) -> _S: ...
Expand Down
6 changes: 3 additions & 3 deletions stdlib/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from enum import Enum
from tkinter.constants import * # comment this out to find undefined identifier names with flake8
from tkinter.font import _FontDescription
from types import TracebackType
from typing import Any, Callable, Generic, List, Mapping, Optional, Protocol, Sequence, Tuple, Type, TypeVar, Union, overload
from typing import Any, Callable, Generic, Mapping, Optional, Protocol, Sequence, Tuple, Type, TypeVar, Union, overload
from typing_extensions import Literal, TypedDict

# Using anything from tkinter.font in this file means that 'import tkinter'
Expand Down Expand Up @@ -82,8 +82,8 @@ EXCEPTION = _tkinter.EXCEPTION
# ...
# _tkinter.TclError: unknown font style "deque(['bold'])"
_T = TypeVar("_T")
_TkinterSequence = Union[List[_T], Tuple[_T, ...]]
_TkinterSequence2D = Union[List[List[_T]], List[Tuple[_T, ...]], Tuple[List[_T], ...], Tuple[Tuple[_T, ...], ...]]
_TkinterSequence = Union[list[_T], Tuple[_T, ...]]
_TkinterSequence2D = Union[list[list[_T]], list[Tuple[_T, ...]], Tuple[list[_T], ...], Tuple[Tuple[_T, ...], ...]]

# Some widgets have an option named -compound that accepts different values
# than the _Compound defined here. Many other options have similar things.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/unittest/loader.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import unittest.case
import unittest.result
import unittest.suite
from types import ModuleType
from typing import Any, Callable, List, Sequence, Type
from typing import Any, Callable, Sequence, Type

_SortComparisonMethod = Callable[[str, str], int]
_SuiteClass = Callable[[List[unittest.case.TestCase]], unittest.suite.TestSuite]
_SuiteClass = Callable[[list[unittest.case.TestCase]], unittest.suite.TestSuite]

class TestLoader:
errors: list[Type[BaseException]]
Expand Down
4 changes: 2 additions & 2 deletions stdlib/unittest/mock.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from typing import Any, Callable, Generic, Iterable, List, Mapping, Sequence, Tuple, Type, TypeVar, overload
from typing import Any, Callable, Generic, Iterable, Mapping, Sequence, Tuple, Type, TypeVar, overload

_F = TypeVar("_F", bound=Callable[..., Any])
_T = TypeVar("_T")
Expand Down Expand Up @@ -60,7 +60,7 @@ class _Call(Tuple[Any, ...]):

call: _Call

class _CallList(List[_Call]):
class _CallList(list[_Call]):
def __contains__(self, value: Any) -> bool: ...

class _MockIter:
Expand Down
4 changes: 2 additions & 2 deletions stdlib/wsgiref/headers.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Pattern, Tuple, overload
from typing import Pattern, Tuple, overload

_HeaderList = List[Tuple[str, str]]
_HeaderList = list[Tuple[str, str]]

tspecials: Pattern[str] # undocumented

Expand Down
4 changes: 2 additions & 2 deletions stdlib/xmlrpc/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ from _typeshed import Self, SupportsRead, SupportsWrite
from datetime import datetime
from io import BytesIO
from types import TracebackType
from typing import Any, Callable, Dict, Iterable, List, Mapping, Protocol, Tuple, Type, Union, overload
from typing import Any, Callable, Dict, Iterable, Mapping, Protocol, Tuple, Type, Union, overload
from typing_extensions import Literal

class _SupportsTimeTuple(Protocol):
def timetuple(self) -> time.struct_time: ...

_DateTimeComparable = Union[DateTime, datetime, str, _SupportsTimeTuple]
_Marshallable = Union[None, bool, int, float, str, bytes, Tuple[Any, ...], List[Any], Dict[Any, Any], datetime, DateTime, Binary]
_Marshallable = Union[None, bool, int, float, str, bytes, Tuple[Any, ...], list[Any], Dict[Any, Any], datetime, DateTime, Binary]
_XMLDate = Union[int, datetime, Tuple[int, ...], time.struct_time]
_HostType = Union[Tuple[str, Dict[str, str]], str]

Expand Down
10 changes: 5 additions & 5 deletions stdlib/xmlrpc/server.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import pydoc
import socketserver
import sys
from datetime import datetime
from typing import Any, Callable, Dict, Iterable, List, Mapping, Pattern, Protocol, Tuple, Type, Union
from typing import Any, Callable, Dict, Iterable, Mapping, Pattern, Protocol, Tuple, Type, Union
from xmlrpc.client import Fault

_Marshallable = Union[
None, bool, int, float, str, bytes, Tuple[Any, ...], List[Any], Dict[Any, Any], datetime
None, bool, int, float, str, bytes, Tuple[Any, ...], list[Any], Dict[Any, Any], datetime
] # TODO: Recursive type on tuple, list, dict

# The dispatch accepts anywhere from 0 to N arguments, no easy way to allow this in mypy
Expand All @@ -34,7 +34,7 @@ class _DispatchArityN(Protocol):
_DispatchProtocol = Union[_DispatchArity0, _DispatchArity1, _DispatchArity2, _DispatchArity3, _DispatchArity4, _DispatchArityN]

def resolve_dotted_attribute(obj: Any, attr: str, allow_dotted_names: bool = ...) -> Any: ... # undocumented
def list_public_methods(obj: Any) -> List[str]: ... # undocumented
def list_public_methods(obj: Any) -> list[str]: ... # undocumented

class SimpleXMLRPCDispatcher: # undocumented

Expand All @@ -57,10 +57,10 @@ class SimpleXMLRPCDispatcher: # undocumented
dispatch_method: Callable[[str | None, Tuple[_Marshallable, ...]], Fault | Tuple[_Marshallable, ...]] | None = ...,
path: Any | None = ...,
) -> str: ... # undocumented
def system_listMethods(self) -> List[str]: ... # undocumented
def system_listMethods(self) -> list[str]: ... # undocumented
def system_methodSignature(self, method_name: str) -> str: ... # undocumented
def system_methodHelp(self, method_name: str) -> str: ... # undocumented
def system_multicall(self, call_list: List[Dict[str, _Marshallable]]) -> List[_Marshallable]: ... # undocumented
def system_multicall(self, call_list: list[Dict[str, _Marshallable]]) -> list[_Marshallable]: ... # undocumented
def _dispatch(self, method: str, params: Iterable[_Marshallable]) -> _Marshallable: ... # undocumented

class SimpleXMLRPCRequestHandler(http.server.BaseHTTPRequestHandler):
Expand Down