Opened 9 months ago
Closed 9 months ago
#35260 closed Bug (invalid)
request.GET is improperly type annotated
Reported by: | Yidi Sprei | Owned by: | nobody |
---|---|---|---|
Component: | HTTP handling | Version: | 5.0 |
Severity: | Normal | Keywords: | |
Cc: | Yidi Sprei | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.
Change History (2)
comment:1 by , 9 months ago
Component: | Uncategorized → HTTP handling |
---|
comment:2 by , 9 months ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Thanks for the ticket, however, Django doesn't use type annotations and I'm not sure what is confusing them.