Add @disjoint_base decorator in the stdlib (#14599)

And fix some other new stubtest finds.
This commit is contained in:
Jelle Zijlstra
2025-08-24 07:27:14 -07:00
committed by GitHub
parent 2565f34946
commit e8ba06f710
55 changed files with 701 additions and 307 deletions
+11 -4
View File
@@ -1,15 +1,22 @@
import sys
from re import error as error
from typing import Final
from typing_extensions import Self
from typing_extensions import Self, disjoint_base
MAXGROUPS: Final[int]
MAGIC: Final[int]
class _NamedIntConstant(int):
name: str
def __new__(cls, value: int, name: str) -> Self: ...
if sys.version_info >= (3, 12):
class _NamedIntConstant(int):
name: str
def __new__(cls, value: int, name: str) -> Self: ...
else:
@disjoint_base
class _NamedIntConstant(int):
name: str
def __new__(cls, value: int, name: str) -> Self: ...
MAXREPEAT: Final[_NamedIntConstant]
OPCODES: list[_NamedIntConstant]