Skip to content

Enhance type of headers.get method.#2129

Merged
davidism merged 1 commit intopallets:2.0.xfrom
bayesimpact:pascal-type-get
May 17, 2021
Merged

Enhance type of headers.get method.#2129
davidism merged 1 commit intopallets:2.0.xfrom
bayesimpact:pascal-type-get

Conversation

@pcorpet
Copy link
Copy Markdown
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
Copy Markdown
Member

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

@pcorpet pcorpet force-pushed the pascal-type-get branch from 3722a24 to 02893e9 Compare May 16, 2021 20:45
@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 pcorpet force-pushed the pascal-type-get branch from 02893e9 to 625aaba Compare May 16, 2021 20:46
@pcorpet
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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