Skip to content

Argument Clinic: fix bare "type" in annotations #112915

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 2 commits into from
Dec 10, 2023
Merged
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
10 changes: 5 additions & 5 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3184,7 +3184,7 @@ def closure(f: CConverterClassT) -> CConverterClassT:

class CConverterAutoRegister(type):
def __init__(
cls, name: str, bases: tuple[type, ...], classdict: dict[str, Any]
cls, name: str, bases: tuple[type[object], ...], classdict: dict[str, Any]
) -> None:
converter_cls = cast(type["CConverter"], cls)
add_c_converter(converter_cls)
Expand Down Expand Up @@ -3217,7 +3217,7 @@ class CConverter(metaclass=CConverterAutoRegister):

# If not None, default must be isinstance() of this type.
# (You can also specify a tuple of types.)
default_type: bltns.type[Any] | tuple[bltns.type[Any], ...] | None = None
default_type: bltns.type[object] | tuple[bltns.type[object], ...] | None = None

# "default" converted into a C value, as a string.
# Or None if there is no default.
Expand Down Expand Up @@ -3683,7 +3683,7 @@ def add_include(self, name: str, reason: str,
ReturnConverterDict = dict[str, ReturnConverterType]
return_converters: ReturnConverterDict = {}

TypeSet = set[bltns.type[Any]]
TypeSet = set[bltns.type[object]]


class bool_converter(CConverter):
Expand Down Expand Up @@ -4347,7 +4347,7 @@ class buffer: pass
class rwbuffer: pass
class robuffer: pass

StrConverterKeyType = tuple[frozenset[type], bool, bool]
StrConverterKeyType = tuple[frozenset[type[object]], bool, bool]

def str_converter_key(
types: TypeSet, encoding: bool | str | None, zeroes: bool
Expand Down Expand Up @@ -4846,7 +4846,7 @@ class CReturnConverterAutoRegister(type):
def __init__(
cls: ReturnConverterType,
name: str,
bases: tuple[type, ...],
bases: tuple[type[object], ...],
classdict: dict[str, Any]
) -> None:
add_c_return_converter(cls)
Expand Down