ITADN

TypeError: type 'Paginator' is not subscriptable

#3196Closed93578237 创建于 2026-03-17
bug
9
93578237commented
# Bug report You can't use generics with Paginator because of https://github.com/typeddjango/django-stubs/pull/3009. django-stubs 5.2.9 supposedly supports django 5.2 ## What's wrong ```python from django.core.paginator import Paginator as _Paginator class MyPaginator[T](_Paginator[T]): pass ``` <!-- Describe what is not working. Please, attach a traceback. We would also appreciate a failing test case. That is EXTREMELY helpful! --> ## How is that should be <!-- Describe how it should work. --> ## System information - OS: GNU/Linux - `python` version: 3.14.3 - `django` version: 5.2.12 - `mypy` version: 1.19.1 - `django-stubs` version: 5.2.9 - `django-stubs-ext` version: 5.2.9
关闭于 2026-03-17 6 条评论