[Django] #35260: request.GET is improperly type annotated

14 views
Skip to first unread message

Django

unread,
Feb 28, 2024, 9:13:03 PM2/28/24
to django-...@googlegroups.com
#35260: request.GET is improperly type annotated
-----------------------------------------+------------------------
Reporter: Yidi Sprei | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 5.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
request.GET does not appear to have proper type hints. If you put () after
request.GET, it raises an error (TypeError: 'QueryDict' object is not
callable) because it is not supposed to be called. So the only way it
works is to have it without calling it and accessing the dictionary that
way. However, typecheckers seem to think that it lacks an instantiation
which makes sense intuitively. This should be pretty easily fixable for
typecheckers by just adding better type-annotations. Or if possible to
make request.GET have a callable that returns the dictionary as well so
that devs can opt for the more pythonic option.
--
Ticket URL: <https://code.djangoproject.com/ticket/35260>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 28, 2024, 9:14:39 PM2/28/24
to django-...@googlegroups.com
#35260: request.GET is improperly type annotated
-------------------------------+--------------------------------------
Reporter: Yidi Sprei | Owner: nobody
Type: Bug | Status: new
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Yidi Sprei):

* component: Uncategorized => HTTP handling

--
Ticket URL: <https://code.djangoproject.com/ticket/35260#comment:1>

Django

unread,
Feb 29, 2024, 12:00:17 AM2/29/24
to django-...@googlegroups.com
#35260: request.GET is improperly type annotated
-------------------------------+--------------------------------------
Reporter: Yidi Sprei | Owner: nobody
Type: Bug | Status: closed
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* resolution: => invalid
* status: new => closed

Comment:

Thanks for the ticket, however, Django doesn't use type annotations and
I'm not sure what is confusing them.
--
Ticket URL: <https://code.djangoproject.com/ticket/35260#comment:2>
Reply all
Reply to author
Forward
0 new messages