Skip to content

Commit

Permalink
Make StrPromise not inherit from Sequence[str] (#1841)
Browse files Browse the repository at this point in the history
* Make `StrPromise` not inherit from `Sequence[str]`

* rm obsolete comment
  • Loading branch information
intgr authored Dec 8, 2023
1 parent 7229151 commit e8bb1ff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions django-stubs/utils/functional.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from collections.abc import Callable, Sequence
from collections.abc import Callable

# Mypy has special handling for functools.cached_property, reuse typeshed's definition instead of defining our own
from functools import cached_property as cached_property
Expand All @@ -20,10 +20,9 @@ class Promise:
def __radd__(self, other: Any) -> Any: ...
def __deepcopy__(self, memo: Any) -> Self: ...

class _StrPromise(Promise, Sequence[str]):
class _StrPromise(Promise):
def __add__(self, __s: str) -> str: ...
# Incompatible with Sequence.__contains__
def __contains__(self, __o: str) -> bool: ... # type: ignore[override]
def __contains__(self, __o: str) -> bool: ...
def __ge__(self, __x: str) -> bool: ...
def __getitem__(self, __i: SupportsIndex | slice) -> str: ...
def __gt__(self, __x: str) -> bool: ...
Expand Down

0 comments on commit e8bb1ff

Please sign in to comment.