Skip to content

Mark pos-only __class_getitem__ args #11970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2024
Merged
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
2 changes: 1 addition & 1 deletion stdlib/_ctypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class Array(_CData, Generic[_CT]):
# Sized and _CData prevents using _CDataMeta.
def __len__(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

def addressof(obj: _CData) -> int: ...
def alignment(obj_or_type: _CData | type[_CData]) -> int: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/_weakref.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ReferenceType(Generic[_T]):
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

ref = ReferenceType

Expand Down
2 changes: 1 addition & 1 deletion stdlib/_weakrefset.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ class WeakSet(MutableSet[_T]):
def __or__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
def isdisjoint(self, other: Iterable[_T]) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
2 changes: 1 addition & 1 deletion stdlib/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ class array(MutableSequence[_T]):
def __buffer__(self, flags: int, /) -> memoryview: ...
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
if sys.version_info >= (3, 12):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

ArrayType = array
2 changes: 1 addition & 1 deletion stdlib/asyncio/futures.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ class Future(Awaitable[_T], Iterable[_T]):
@property
def _loop(self) -> AbstractEventLoop: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ...
2 changes: 1 addition & 1 deletion stdlib/asyncio/queues.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Queue(Generic[_T], _LoopBoundMixin): # noqa: Y059
async def join(self) -> None: ...
def task_done(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, type: Any) -> GenericAlias: ...
def __class_getitem__(cls, type: Any, /) -> GenericAlias: ...

class PriorityQueue(Queue[_T]): ...
class LifoQueue(Queue[_T]): ...
2 changes: 1 addition & 1 deletion stdlib/asyncio/tasks.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportIn
@classmethod
def all_tasks(cls, loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ...

Expand Down
2 changes: 1 addition & 1 deletion stdlib/concurrent/futures/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Future(Generic[_T]):
def exception(self, timeout: float | None = None) -> BaseException | None: ...
def set_exception(self, exception: BaseException | None) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class Executor:
if sys.version_info >= (3, 9):
Expand Down
2 changes: 1 addition & 1 deletion stdlib/concurrent/futures/thread.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class _WorkItem(Generic[_S]):
def __init__(self, future: Future[_S], fn: Callable[..., _S], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ...
def run(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

def _worker(
executor_reference: ref[Any],
Expand Down
4 changes: 2 additions & 2 deletions stdlib/contextvars.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextVar(Generic[_T]):
def set(self, value: _T, /) -> Token[_T]: ...
def reset(self, token: Token[_T], /) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

@final
class Token(Generic[_T]):
Expand All @@ -40,7 +40,7 @@ class Token(Generic[_T]):
def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express
MISSING: ClassVar[object]
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

def copy_context() -> Context: ...

Expand Down
4 changes: 2 additions & 2 deletions stdlib/csv.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class DictReader(Iterator[dict[_T | Any, str | Any]], Generic[_T]):
def __iter__(self) -> Self: ...
def __next__(self) -> dict[_T | Any, str | Any]: ...
if sys.version_info >= (3, 12):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class DictWriter(Generic[_T]):
fieldnames: Collection[_T]
Expand Down Expand Up @@ -139,7 +139,7 @@ class DictWriter(Generic[_T]):
def writerow(self, rowdict: Mapping[_T, Any]) -> Any: ...
def writerows(self, rowdicts: Iterable[Mapping[_T, Any]]) -> None: ...
if sys.version_info >= (3, 12):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class Sniffer:
preferred: list[str]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/ctypes/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class LibraryLoader(Generic[_DLLT]):
def __getitem__(self, name: str) -> _DLLT: ...
def LoadLibrary(self, name: str) -> _DLLT: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

cdll: LibraryLoader[CDLL]
if sys.platform == "win32":
Expand Down
2 changes: 1 addition & 1 deletion stdlib/dataclasses.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Field(Generic[_T]):

def __set_name__(self, owner: Type[Any], name: str) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers
# to understand the magic that happens at runtime.
Expand Down
2 changes: 1 addition & 1 deletion stdlib/difflib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SequenceMatcher(Generic[_T]):
def quick_ratio(self) -> float: ...
def real_quick_ratio(self) -> float: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

@overload
def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = 3, cutoff: float = 0.6) -> list[AnyStr]: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/filecmp.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ class dircmp(Generic[AnyStr]):
def phase4(self) -> None: ...
def phase4_closure(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

def clear_cache() -> None: ...
2 changes: 1 addition & 1 deletion stdlib/fileinput.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class FileInput(Iterator[AnyStr]):
def isfirstline(self) -> bool: ...
def isstdin(self) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

if sys.version_info >= (3, 10):
def hook_compressed(
Expand Down
6 changes: 3 additions & 3 deletions stdlib/functools.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class partial(Generic[_T]):
def __new__(cls, func: Callable[..., _T], /, *args: Any, **kwargs: Any) -> Self: ...
def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

# With protocols, this could change into a generic protocol that defines __get__ and returns _T
_Descriptor: TypeAlias = Any
Expand All @@ -149,7 +149,7 @@ class partialmethod(Generic[_T]):
@property
def __isabstractmethod__(self) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class _SingleDispatchCallable(Generic[_T]):
registry: types.MappingProxyType[Any, Callable[..., _T]]
Expand Down Expand Up @@ -196,7 +196,7 @@ class cached_property(Generic[_T_co]):
# __set__ is not defined at runtime, but @cached_property is designed to be settable
def __set__(self, instance: object, value: _T_co) -> None: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

if sys.version_info >= (3, 9):
def cache(user_function: Callable[..., _T], /) -> _lru_cache_wrapper[_T]: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/graphlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ class TopologicalSorter(Generic[_T]):
def get_ready(self) -> tuple[_T, ...]: ...
def static_order(self) -> Iterable[_T]: ...
if sys.version_info >= (3, 11):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class CycleError(ValueError): ...
2 changes: 1 addition & 1 deletion stdlib/http/cookies.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Morsel(dict[str, Any], Generic[_T]):
def __eq__(self, morsel: object) -> bool: ...
def __setitem__(self, K: str, V: Any) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class BaseCookie(dict[str, Morsel[_T]], Generic[_T]):
def __init__(self, input: _DataType | None = None) -> None: ...
Expand Down
4 changes: 2 additions & 2 deletions stdlib/logging/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ class LoggerAdapter(Generic[_L]):
@property
def name(self) -> str: ... # undocumented
if sys.version_info >= (3, 11):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

def getLogger(name: str | None = None) -> Logger: ...
def getLoggerClass() -> type[Logger]: ...
Expand Down Expand Up @@ -600,7 +600,7 @@ class StreamHandler(Handler, Generic[_StreamT]):
def __init__(self: StreamHandler[_StreamT], stream: _StreamT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780
def setStream(self, stream: _StreamT) -> _StreamT | None: ...
if sys.version_info >= (3, 11):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class FileHandler(StreamHandler[TextIOWrapper]):
baseFilename: str # undocumented
Expand Down
4 changes: 2 additions & 2 deletions stdlib/mailbox.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Mailbox(Generic[_MessageT]):
@abstractmethod
def close(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class Maildir(Mailbox[MaildirMessage]):
colon: str
Expand Down Expand Up @@ -244,7 +244,7 @@ class _ProxyFile(Generic[AnyStr]):
@property
def closed(self) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class _PartialFile(_ProxyFile[AnyStr]):
def __init__(self, f: IO[AnyStr], start: int | None = None, stop: int | None = None) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/multiprocessing/managers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ValueProxy(BaseProxy, Generic[_T]):
def set(self, value: _T) -> None: ...
value: _T
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class DictProxy(BaseProxy, MutableMapping[_KT, _VT]):
__builtins__: ClassVar[dict[str, Any]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/multiprocessing/pool.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ApplyResult(Generic[_T]):
def ready(self) -> bool: ...
def successful(self) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

# alias created during issue #17805
AsyncResult = ApplyResult
Expand Down
2 changes: 1 addition & 1 deletion stdlib/multiprocessing/queues.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ class SimpleQueue(Generic[_T]):
def get(self) -> _T: ...
def put(self, obj: _T) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
2 changes: 1 addition & 1 deletion stdlib/multiprocessing/shared_memory.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ class ShareableList(Generic[_SLT]):
def count(self, value: _SLT) -> int: ...
def index(self, value: _SLT) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
2 changes: 1 addition & 1 deletion stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class DirEntry(Generic[AnyStr]):
def stat(self, *, follow_symlinks: bool = True) -> stat_result: ...
def __fspath__(self) -> AnyStr: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
if sys.version_info >= (3, 12):
def is_junction(self) -> bool: ...

Expand Down
4 changes: 2 additions & 2 deletions stdlib/queue.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Queue(Generic[_T]):
def _qsize(self) -> int: ...
def task_done(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class PriorityQueue(Queue[_T]):
queue: list[_T]
Expand All @@ -63,4 +63,4 @@ class SimpleQueue(Generic[_T]):
def put_nowait(self, item: _T) -> None: ...
def qsize(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
4 changes: 2 additions & 2 deletions stdlib/re.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Match(Generic[AnyStr]):
def __copy__(self) -> Match[AnyStr]: ...
def __deepcopy__(self, memo: Any, /) -> Match[AnyStr]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

@final
class Pattern(Generic[AnyStr]):
Expand Down Expand Up @@ -178,7 +178,7 @@ class Pattern(Generic[AnyStr]):
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

# ----- re variables and constants -----

Expand Down
4 changes: 2 additions & 2 deletions stdlib/subprocess.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class CompletedProcess(Generic[_T]):
def __init__(self, args: _CMD, returncode: int, stdout: _T | None = None, stderr: _T | None = None) -> None: ...
def check_returncode(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

if sys.version_info >= (3, 11):
# 3.11 adds "process_group" argument
Expand Down Expand Up @@ -2560,7 +2560,7 @@ class Popen(Generic[AnyStr]):
) -> None: ...
def __del__(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

# The result really is always a str.
if sys.version_info >= (3, 11):
Expand Down
4 changes: 2 additions & 2 deletions stdlib/tempfile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase):
def writable(self) -> bool: ...
def __next__(self) -> AnyStr: ... # type: ignore[override]
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class TemporaryDirectory(Generic[AnyStr]):
name: AnyStr
Expand Down Expand Up @@ -457,7 +457,7 @@ class TemporaryDirectory(Generic[AnyStr]):
def __enter__(self) -> AnyStr: ...
def __exit__(self, exc: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

# The overloads overlap, but they should still work fine.
@overload
Expand Down
2 changes: 1 addition & 1 deletion stdlib/types.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class MappingProxyType(Mapping[_KT, _VT_co]):
def values(self) -> ValuesView[_VT_co]: ...
def items(self) -> ItemsView[_KT, _VT_co]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def __reversed__(self) -> Iterator[_KT]: ...
def __or__(self, value: Mapping[_T1, _T2], /) -> dict[_KT | _T1, _VT_co | _T2]: ...
def __ror__(self, value: Mapping[_T1, _T2], /) -> dict[_KT | _T1, _VT_co | _T2]: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/unittest/case.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class _AssertRaisesContext(_AssertRaisesBaseContext, Generic[_E]):
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None
) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class _AssertWarnsContext(_AssertRaisesBaseContext):
warning: WarningMessage
Expand Down
2 changes: 1 addition & 1 deletion stdlib/urllib/parse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _NetlocResultMixinBase(Generic[AnyStr]):
@property
def port(self) -> int | None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ...
class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/regex/regex/regex.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ class Pattern(Generic[AnyStr]):
def __copy__(self) -> Self: ...
def __deepcopy__(self) -> Self: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

@final
class Match(Generic[AnyStr]):
Expand Down Expand Up @@ -649,4 +649,4 @@ class Match(Generic[AnyStr]):
def __copy__(self) -> Self: ...
def __deepcopy__(self) -> Self: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...