from collections.abc import Callable
from typing import Any, TypeVar
F = TypeVar("F", bound=Callable[..., Any])
require_GET: Callable[[F], F]
@require_GET
def view() -> Any: ...
ERROR Argument `() -> Any` is not assignable to parameter with type `TypeVar[F]` [bad-argument-type]
--> x.pyi:8:1
|
8 | @require_GET
| ^^^^^^^^^^^^
|
Describe the Bug
This is similar to #1555, however the commit 59098f4 included in 0.48.0 did not resolve the issue as I encounter it. Please see the unexpected error below, I tried to minimize it (see https://github.com/typeddjango/django-stubs/blob/f788f6ce9833c6805bad7a3cd19c77893b9f9063/django-stubs/views/decorators/http.pyi for the real definition of
require_GET).Error:
Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIIANCGQE4xhSmEAuuAtlBQMQAEABVIMmpPmix58fAMa50kAOYBXOqlYR5hADrp%2BAZRgw%2BAC1aticRAHpr9Rs0K46i6zHTXMuGXGtyFECpqGvLWfGDOfKgAbqjQqNiwsvJKquqa6Hy4xCHocDroZKwm8gC00TB0cBl8ALx82iAAzIQAjABMjbrUIERkEBRgdJzJULAyufkJMnwQHMTOrHwAwqhjCbC6QyOspMQQ6Iqz84t8AILopFR8ACp7MABqqHS6ugBidbf3T3QAFI1vRrXPDKLC1VbrRIwADahDh1wupAAugBKV7oBgAR2UEAYAH0AOIAURuiBWaygGxh0LeSOutPRAAEsTj8cSbrpMIw%2BNEIDAAO6-FF8UoAPnOlzJcMIIAAvjRUBMIBU3tAYBQ%2BqQBrKgA
(Only applicable for extension issues) IDE Information
No response