Add various missing generic arguments (#7702)

Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Sebastian Rittau
2022-04-27 14:25:35 +02:00
committed by GitHub
parent ae09e4e866
commit 2d468966f5
9 changed files with 17 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
import typing
from typing import Any, Match
from typing import Any, ClassVar, Match
from xml.etree.ElementTree import Element
def build_inlinepatterns(md, **kwargs): ...
@@ -94,7 +94,7 @@ class LinkInlineProcessor(InlineProcessor):
class ImageInlineProcessor(LinkInlineProcessor): ...
class ReferenceInlineProcessor(LinkInlineProcessor):
NEWLINE_CLEANUP_RE: typing.Pattern
NEWLINE_CLEANUP_RE: ClassVar[typing.Pattern[str]]
def evalId(self, data, index, text): ...
def makeTag(self, href, title, text): ...

View File

@@ -47,10 +47,10 @@ class PdfName:
class PdfArray(list[Any]):
def __bytes__(self): ...
class PdfDict(collections.UserDict):
class PdfDict(collections.UserDict[bytes, Any]):
def __setattr__(self, key, value) -> None: ...
def __getattr__(self, key): ...
def __bytes__(self): ...
def __bytes__(self) -> bytes: ...
class PdfBinary:
data: Any

View File

@@ -20,7 +20,7 @@ CONTAINED_BY: _Any
OVERLAP: _Any
class ARRAY(sqltypes.ARRAY):
class Comparator(sqltypes.ARRAY.Comparator):
class Comparator(sqltypes.ARRAY.Comparator[_Any]):
def contains(self, other, **kwargs): ...
def contained_by(self, other): ...
def overlap(self, other): ...

View File

@@ -10,7 +10,7 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine):
text_type: Any
def __init__(self, text_type: Any | None = ...) -> None: ...
class Comparator(sqltypes.Indexable.Comparator, sqltypes.Concatenable.Comparator):
class Comparator(sqltypes.Indexable.Comparator[Any], sqltypes.Concatenable.Comparator[Any]):
def has_key(self, other): ...
def has_all(self, other): ...
def has_any(self, other): ...

View File

@@ -3,7 +3,7 @@ from typing import Any
import sqlalchemy.types as sqltypes
class RangeOperators:
class comparator_factory(sqltypes.Concatenable.Comparator):
class comparator_factory(sqltypes.Concatenable.Comparator[Any]):
def __ne__(self, other): ...
def contains(self, other, **kw): ...
def contained_by(self, other): ...

View File

@@ -4,7 +4,7 @@ from ..sql import operators
class UnevaluatableError(Exception): ...
class _NoObject(operators.ColumnOperators):
class _NoObject(operators.ColumnOperators[Any]):
def operate(self, *arg, **kw) -> None: ...
def reverse_operate(self, *arg, **kw) -> None: ...

View File

@@ -75,7 +75,7 @@ class TypeDecorator(ExternalType, SchemaEventTarget, TypeEngine):
def __init__(self, *args, **kwargs) -> None: ...
coerce_to_is_types: Any
class Comparator(TypeEngine.Comparator):
class Comparator(TypeEngine.Comparator[Any]):
def operate(self, op, *other, **kwargs): ...
def reverse_operate(self, op, other, **kwargs): ...

View File

@@ -1,4 +1,4 @@
import collections.abc as _abc
from collections.abc import MutableMapping
from typing import Any
def normalize_locale(name): ...
@@ -13,7 +13,7 @@ class Alias:
def __init__(self, keys) -> None: ...
def resolve(self, data): ...
class LocaleDataDict(_abc.MutableMapping):
class LocaleDataDict(MutableMapping[Any, Any]):
base: Any
def __init__(self, data, base: Any | None = ...) -> None: ...
def __len__(self): ...

View File

@@ -1,9 +1,12 @@
import collections
from typing import Any
from collections import OrderedDict
from typing import Any, Generic, TypeVar
from humanfriendly.compat import unicode
class CaseInsensitiveDict(collections.OrderedDict):
_KT = TypeVar("_KT")
_VT = TypeVar("_VT")
class CaseInsensitiveDict(OrderedDict[_KT, _VT], Generic[_KT, _VT]):
def __init__(self, other: Any | None = ..., **kw) -> None: ...
def coerce_key(self, key): ...
@classmethod