Skip to content

Commit

Permalink
fixes from MR review
Browse files Browse the repository at this point in the history
  • Loading branch information
GabDug committed Jun 26, 2023
1 parent 6ad9c4c commit 3cba615
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion django-stubs/utils/decorators.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def decorator_from_middleware_with_args(middleware_class: type) -> Callable: ...
def decorator_from_middleware(middleware_class: type) -> Callable: ...
def make_middleware_decorator(middleware_class: type[MiddlewareMixin]) -> Callable: ...
@type_check_only
class AsyncGetResponseCallable(Protocol):
class _AsyncGetResponseCallable(Protocol):
def __call__(self, __request: HttpRequest) -> Awaitable[HttpResponseBase]: ...

def sync_and_async_middleware(func: _CallableType) -> _CallableType: ...
Expand Down
3 changes: 2 additions & 1 deletion django-stubs/utils/functional.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class LazyObject:
def __delattr__(self, name: str) -> None: ...
def __reduce__(self) -> tuple[Callable, tuple[Model]]: ...
def __copy__(self) -> LazyObject: ...
def __deepcopy__(self, memo: dict[int, Any]) -> LazyObject: ...
# TODO: Deepcopy can return a LazyObject or a wrapped object, but we'll need to make LazyObject generic first
def __deepcopy__(self, memo: dict[int, Any]) -> Any: ...
__bytes__: Callable
__bool__: Callable
__dir__: Callable
Expand Down
4 changes: 0 additions & 4 deletions scripts/stubtest/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ django.utils.datastructures.ImmutableList.remove
django.utils.datastructures.ImmutableList.sort
django.utils.datastructures.ImmutableList.reverse

# Django-stubs protocol (XXX not used internally, check usage/issues)
django.utils.decorators.AsyncGetResponseCallable
django.utils.deprecation.GetResponseCallable

# Promise is lazy, see notes in .pyi
django.utils.functional.Promise.__add__
django.utils.functional.Promise.__deepcopy__
Expand Down

0 comments on commit 3cba615

Please sign in to comment.