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

[PR #8211/7725f5a2 backport][3.9] Fix type annotations on MultipartWriter.append #8214

Conversation

patchback[bot]
Copy link
Contributor

@patchback patchback bot commented Mar 8, 2024

This is a backport of PR #8211 as merged into master (7725f5a).

What do these changes do?

They adjust the annotations on the MultipartWriter.append method (and two similar methods), so that type-checkers admit plain python dictionaries for the second argument; the headers parameter.

I chose to use LooseHeaders as I knew it was already used as the headers parameter for the web.Response constructor, among others. Changed to Mapping[str, str] , thank you Dreamsorcerer

Are there changes in behavior for the user?

No, this doesn't change any behaviour.

Is it a substantial burden for the maintainers to support this?

Not that I can imagine.

Related issue number

Fixes #7741

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
    • Documentation already gives examples
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES/ folder
    • name it <issue_or_pr_num>.<type>.rst (e.g. 588.bugfix.rst)

    • if you don't have an issue number, change it to the pull request
      number after creating the PR

      • .bugfix: A bug fix for something the maintainers deemed an
        improper undesired behavior that got corrected to match
        pre-agreed expectations.
      • .feature: A new behavior, public APIs. That sort of stuff.
      • .deprecation: A declaration of future API removals and breaking
        changes in behavior.
      • .breaking: When something public is removed in a breaking way.
        Could be deprecated in an earlier release.
      • .doc: Notable updates to the documentation structure or build
        process.
      • .packaging: Notes for downstreams about unobvious side effects
        and tooling. Changes in the test invocation considerations and
        runtime assumptions.
      • .contrib: Stuff that affects the contributor experience. e.g.
        Running tests, building the docs, setting up the development
        environment.
      • .misc: Changes that are hard to assign to any of the above
        categories.
    • Make sure to use full sentences with correct case and punctuation,
      for example:

      Fixed issue with non-ascii contents in doctest text files
      -- by :user:`contributor-gh-handle`.

      Use the past tense or the present tense a non-imperative mood,
      referring to what's changed compared to the last released version
      of this project.

Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.36%. Comparing base (0153145) to head (4b07e13).

Additional details and impacted files
@@           Coverage Diff           @@
##              3.9    #8214   +/-   ##
=======================================
  Coverage   97.36%   97.36%           
=======================================
  Files         108      108           
  Lines       32637    32637           
  Branches     3874     3874           
=======================================
  Hits        31778    31778           
  Misses        655      655           
  Partials      204      204           
Flag Coverage Δ
CI-GHA 97.27% <100.00%> (ø)
OS-Linux 96.96% <100.00%> (ø)
OS-Windows 94.47% <100.00%> (ø)
OS-macOS 96.58% <100.00%> (ø)
Py-3.10.11 94.37% <100.00%> (ø)
Py-3.10.13 96.75% <100.00%> (ø)
Py-3.11.8 96.47% <100.00%> (ø)
Py-3.12.2 96.52% <100.00%> (ø)
Py-3.8.10 94.35% <100.00%> (ø)
Py-3.8.18 96.68% <100.00%> (ø)
Py-3.9.13 94.36% <100.00%> (ø)
Py-3.9.18 96.73% <100.00%> (ø)
Py-pypy7.3.15 96.27% <100.00%> (ø)
VM-macos 96.58% <100.00%> (ø)
VM-ubuntu 96.96% <100.00%> (ø)
VM-windows 94.47% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Dreamsorcerer Dreamsorcerer merged commit c427e6d into 3.9 Mar 9, 2024
27 of 31 checks passed
@Dreamsorcerer Dreamsorcerer deleted the patchback/backports/3.9/7725f5a22f4ca64dfb01478d640763910b036192/pr-8211 branch March 9, 2024 12:53
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 this pull request may close these issues.

2 participants