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

Enhance type of headers.get method. #2129

Merged
merged 1 commit into from May 17, 2021

Conversation

pcorpet
Copy link
Contributor

@pcorpet pcorpet commented May 16, 2021

When given a default value that is not None, the get method always returns a string.

I haven't seen any tests that checks for the types themselves, although I've changed one instance of usage in the werkzeug code itself that would fail without the typing change.

Checklist:

  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@ThiefMaster
Copy link
Member

This should probably be rebased against 2.0.x (and the upstream branch changed here in the PR's settings)

@pcorpet pcorpet changed the base branch from main to 2.0.x May 16, 2021 20:45
When given a default value that is not None, the get method always
returns a string.
@pcorpet
Copy link
Contributor Author

pcorpet commented May 16, 2021

Thanks @ThiefMaster , I hadn't seen that there was a new dev version in the works.

@davidism davidism added this to the 2.0.1 milestone May 17, 2021
@davidism
Copy link
Member

It seems you've made this PR from an organization account instead of your own, which means I can't push to it to prepare it for merge. Try to avoid this in the future, it's more convenient for maintainers to be able to modify PRs in place.

@davidism davidism merged commit 1b8907a into pallets:2.0.x May 17, 2021
@pcorpet
Copy link
Contributor Author

pcorpet commented May 17, 2021

@davidism , sorry about that. I thought I had set the "maintainers can modify" flag. I'll be careful next time

@pcorpet pcorpet deleted the pascal-type-get branch May 17, 2021 20:24
@davidism
Copy link
Member

davidism commented May 17, 2021

From my experience, the setting doesn't seem to work on org prs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stronger typing for request.headers.get method
3 participants