Never explicitly inherit from object in Python 3-only stubs (#6777)

This commit is contained in:
Alex Waygood
2022-01-02 06:24:48 +00:00
committed by GitHub
parent d43cd997a4
commit 505ea72641
35 changed files with 79 additions and 67 deletions

View File

@@ -3,7 +3,7 @@ from typing import Iterable
from dateutil.relativedelta import relativedelta
class DateTimeRange(object):
class DateTimeRange:
NOT_A_TIME_STR: str
start_time_format: str
end_time_format: str

View File

@@ -1,16 +1,16 @@
from collections.abc import Generator, Iterable
from typing import Any
class HTMLParser(object): # actually html5lib.HTMLParser
class HTMLParser: # actually html5lib.HTMLParser
def __getattr__(self, __name: str) -> Any: ... # incomplete
class Filter(object): # actually html5lib.filters.base.Filter
class Filter: # actually html5lib.filters.base.Filter
def __getattr__(self, __name: str) -> Any: ... # incomplete
class SanitizerFilter(object): # actually html5lib.filters.sanitizer.Filter
class SanitizerFilter: # actually html5lib.filters.sanitizer.Filter
def __getattr__(self, __name: str) -> Any: ... # incomplete
class HTMLSerializer(object): # actually html5lib.serializer.HTMLSerializer
class HTMLSerializer: # actually html5lib.serializer.HTMLSerializer
def __getattr__(self, __name: str) -> Any: ... # incomplete
class BleachHTMLParser(HTMLParser):

View File

@@ -21,7 +21,7 @@ def build_email_re(tlds: Iterable[str] = ...) -> Pattern[str]: ...
EMAIL_RE: Pattern[str]
class Linker(object):
class Linker:
def __init__(
self,
callbacks: Iterable[_Callback] = ...,

View File

@@ -15,7 +15,7 @@ INVISIBLE_REPLACEMENT_CHAR: str
# A html5lib Filter class
_Filter = Any
class Cleaner(object):
class Cleaner:
tags: Container[str]
attributes: _Attributes
styles: Container[str]

View File

@@ -30,7 +30,7 @@ DEF: Pattern[str]
_dict = dict # conflicts with attribute name
class FunctionMaker(object):
class FunctionMaker:
args: list[Text]
varargs: Text | None
varkw: Text | None

View File

@@ -6,17 +6,17 @@ from typing import Any, Type, TypeVar, Union, overload
_T = TypeVar("_T")
_Freezable = Union[str, datetime, date, timedelta]
class TickingDateTimeFactory(object):
class TickingDateTimeFactory:
def __init__(self, time_to_freeze: datetime, start: datetime) -> None: ...
def __call__(self) -> datetime: ...
class FrozenDateTimeFactory(object):
class FrozenDateTimeFactory:
def __init__(self, time_to_freeze: datetime) -> None: ...
def __call__(self) -> datetime: ...
def tick(self, delta: float | Real | timedelta = ...) -> None: ...
def move_to(self, target_datetime: _Freezable | None) -> None: ...
class StepTickTimeFactory(object):
class StepTickTimeFactory:
def __init__(self, time_to_freeze: datetime, step_width: float) -> None: ...
def __call__(self) -> datetime: ...
def tick(self, delta: timedelta | None = ...) -> None: ...

View File

@@ -18,7 +18,7 @@ def version_info() -> tuple[int, str, int, str, int, str, int, str, tuple[str, .
class error(Exception): ...
class Curl(object):
class Curl:
def close(self) -> None: ...
def setopt(self, option: int, value: Any) -> None: ...
def setopt_string(self, option: int, value: str) -> None: ...
@@ -34,7 +34,7 @@ class Curl(object):
# TODO(MichalPokorny): wat?
USERPWD: int
class CurlMulti(object):
class CurlMulti:
def close(self) -> None: ...
def add_handle(self, obj: Curl) -> None: ...
def remove_handle(self, obj: Curl) -> None: ...
@@ -44,7 +44,7 @@ class CurlMulti(object):
def info_read(self, max_objects: int = ...) -> tuple[int, list[Any], list[Any]]: ...
def socket_action(self, sockfd: int, ev_bitmask: int) -> tuple[int, int]: ...
class CurlShare(object):
class CurlShare:
def close(self) -> None: ...
def setopt(self, option: int, value: Any) -> Any: ...

View File

@@ -689,7 +689,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
def cluster(self, cluster_arg: str, *args: Any) -> Pipeline[_StrType]: ... # type: ignore[override]
def client(self) -> Any: ...
class Monitor(object):
class Monitor:
command_re: Pattern[str]
monitor_re: Pattern[str]
def __init__(self, connection_pool) -> None: ...