Restore Python 3.7 compatibility (#945)

django-stubs still supports Python 3.7, but the `/` positional-only parameter syntax is supported only in Python 3.8+.

Not sure why this error wasn't caught in CI.
This commit is contained in:
Marti Raudsepp
2022-04-29 08:51:56 +03:00
committed by GitHub
parent c836c3ac3a
commit 2b0bfdb46e

View File

@@ -161,9 +161,9 @@ class QueryDict(MultiValueDict[str, str]):
def appendlist(self, key: Union[str, bytes], value: Union[str, bytes]) -> None: ...
# Fake signature (because *args is used in source, but it fails with more that 1 argument)
@overload
def pop(self, key: Union[str, bytes], /) -> str: ...
def pop(self, __key: Union[str, bytes]) -> str: ...
@overload
def pop(self, key: Union[str, bytes], default: Union[str, _Z] = ..., /) -> Union[str, _Z]: ...
def pop(self, __key: Union[str, bytes], __default: Union[str, _Z] = ...) -> Union[str, _Z]: ...
def popitem(self) -> Tuple[str, str]: ...
def clear(self) -> None: ...
def setdefault(self, key: Union[str, bytes], default: Union[str, bytes, None] = ...) -> str: ...
@@ -182,9 +182,9 @@ class _ImmutableQueryDict(QueryDict):
def appendlist(self, key: Union[str, bytes], value: Union[str, bytes]) -> NoReturn: ...
# Fake signature (because *args is used in source, but it fails with more that 1 argument)
@overload
def pop(self, key: Union[str, bytes], /) -> NoReturn: ...
def pop(self, __key: Union[str, bytes]) -> NoReturn: ...
@overload
def pop(self, key: Union[str, bytes], default: Union[str, _Z] = ..., /) -> NoReturn: ...
def pop(self, __key: Union[str, bytes], __default: Union[str, _Z] = ...) -> NoReturn: ...
def popitem(self) -> NoReturn: ...
def clear(self) -> NoReturn: ...
def setdefault(self, key: Union[str, bytes], default: Union[str, bytes, None] = ...) -> NoReturn: ...