Skip to content
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

Make StrPromise not inherit from Sequence[str] #1841

Merged
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 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,10 @@ 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]
intgr marked this conversation as resolved.
Show resolved Hide resolved
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
Loading