mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
Fixed base classes to avoid "Cannot create consistent method ordering" error. Like the Python interpreter, the pyright type checker reports an error when a class is defined in a way that a deterministic MRO cannot be established. This set of changes eliminates these errors. (#4392)
Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
2
third_party/2and3/click/_termui_impl.pyi
vendored
2
third_party/2and3/click/_termui_impl.pyi
vendored
@@ -2,7 +2,7 @@ from typing import Generic, Optional, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class ProgressBar(object, Generic[_T]):
|
||||
class ProgressBar(Generic[_T]):
|
||||
def update(self, n_steps: int) -> None: ...
|
||||
def finish(self) -> None: ...
|
||||
def __enter__(self) -> ProgressBar[_T]: ...
|
||||
|
||||
4
third_party/2and3/pynamodb/attributes.pyi
vendored
4
third_party/2and3/pynamodb/attributes.pyi
vendored
@@ -81,7 +81,7 @@ class NullAttribute(Attribute[None]):
|
||||
class MapAttributeMeta(type):
|
||||
def __init__(self, name, bases, attrs) -> None: ...
|
||||
|
||||
class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]], metaclass=MapAttributeMeta):
|
||||
class MapAttribute(Attribute[Mapping[_KT, _VT]], metaclass=MapAttributeMeta):
|
||||
attribute_values: Any
|
||||
def __init__(
|
||||
self,
|
||||
@@ -100,7 +100,7 @@ class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]], metaclass=Ma
|
||||
def is_type_safe(self, key: Any, value: Any) -> bool: ...
|
||||
def validate(self) -> bool: ...
|
||||
|
||||
class ListAttribute(Generic[_T], Attribute[List[_T]]):
|
||||
class ListAttribute(Attribute[List[_T]]):
|
||||
element_type: Any
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
2
third_party/2and3/pynamodb/models.pyi
vendored
2
third_party/2and3/pynamodb/models.pyi
vendored
@@ -150,7 +150,7 @@ class ModelContextManager(Generic[_T]):
|
||||
def __init__(self, model: Type[_T], auto_commit: bool = ...) -> None: ...
|
||||
def __enter__(self) -> ModelContextManager[_T]: ...
|
||||
|
||||
class BatchWrite(Generic[_T], ModelContextManager[_T]):
|
||||
class BatchWrite(ModelContextManager[_T]):
|
||||
def save(self, put_item: _T) -> None: ...
|
||||
def delete(self, del_item: _T) -> None: ...
|
||||
def __enter__(self) -> BatchWrite[_T]: ...
|
||||
|
||||
@@ -30,7 +30,7 @@ def is_immutable(self) -> NoReturn: ...
|
||||
def iter_multi_items(mapping): ...
|
||||
def native_itermethods(names): ...
|
||||
|
||||
class ImmutableListMixin(object, Generic[_V]):
|
||||
class ImmutableListMixin(Generic[_V]):
|
||||
def __hash__(self) -> int: ...
|
||||
def __reduce_ex__(self: _D, protocol) -> Tuple[Type[_D], List[_V]]: ...
|
||||
def __delitem__(self, key: _V) -> NoReturn: ...
|
||||
|
||||
Reference in New Issue
Block a user