From 453f05c113b14c8327efd030bc3757b9e9df66e3 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 2 Aug 2024 13:46:24 +0100 Subject: [PATCH] Use `Any` for `ConnectionProxy` attributes Whilst the type is generic, it is not a wrapper - `__getattr__` should not return the inner type. --- django-stubs/utils/connection.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/utils/connection.pyi b/django-stubs/utils/connection.pyi index b6146f117..1a99b09fa 100644 --- a/django-stubs/utils/connection.pyi +++ b/django-stubs/utils/connection.pyi @@ -7,8 +7,8 @@ _T = TypeVar("_T") class ConnectionProxy(Generic[_T]): def __init__(self, connections: BaseConnectionHandler[_T], alias: str) -> None: ... - def __getattr__(self, item: str) -> _T: ... - def __setattr__(self, name: str, value: _T) -> None: ... + def __getattr__(self, item: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... def __delattr__(self, name: str) -> None: ... def __contains__(self, key: str) -> bool: ... def __eq__(self, other: object) -> bool: ...