Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate typing for body/query argument getters #3336

Open
thijsvandien opened this issue Oct 7, 2023 · 0 comments · May be fixed by #3378
Open

Inaccurate typing for body/query argument getters #3336

thijsvandien opened this issue Oct 7, 2023 · 0 comments · May be fixed by #3378

Comments

@thijsvandien
Copy link

The return type of RequestHandler.get_argument depends on a default being provided or not, accounted for using appropriate overloads. Unfortunately, the same isn't true for RequestHandler.get_body_argument and RequestHandler.get_query_argument, which simply declare Optional[str].

Perhaps those need similar overloads, or they could be moved over to RequestHandler._get_argument, called by all...? I'm not sure if most type checkers would infer the rest from that.

pcavalar added a commit to pcavalar/tornado that referenced this issue May 17, 2024
Use the same overload technique as get_argument().

Fixes tornadoweb#3336
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant