Skip to content

Upgrade typehints to 3.10 annotations and remove 3.9 Union and Optional typehints#1324

Open
Vizonex wants to merge 3 commits intoaio-libs:masterfrom
Vizonex:py310-upgrade
Open

Upgrade typehints to 3.10 annotations and remove 3.9 Union and Optional typehints#1324
Vizonex wants to merge 3 commits intoaio-libs:masterfrom
Vizonex:py310-upgrade

Conversation

@Vizonex
Copy link
Copy Markdown
Member

@Vizonex Vizonex commented Apr 22, 2026

What do these changes do?

3.9 was dropped recently so I've chosen to upgrade the annotations away from 3.9 and into 3.10 which includes new the popular pipe syntax instead of Union[A, B] or Optional[A] in favor of A | B A | None instead.

Are there changes in behavior for the user?

Users will likely enjoy the changes from the new 3.10 annotations over the older Union and Optional type hints especially since these types are both deprecated.

Related issue number

This pull request is related to changes from #1316

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

@Vizonex Vizonex requested a review from asvetlov as a code owner April 22, 2026 00:17
@Vizonex Vizonex requested a review from webknjaz as a code owner April 22, 2026 00:18
Comment thread multidict/_abc.py Dismissed
Comment thread multidict/_abc.py Dismissed
Comment thread multidict/_abc.py Dismissed
Comment thread multidict/_abc.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Apr 22, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 22, 2026

Merging this PR will not alter performance

✅ 245 untouched benchmarks


Comparing Vizonex:py310-upgrade (1439ee8) with master (637ffa9)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.86%. Comparing base (637ffa9) to head (1439ee8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1324   +/-   ##
=======================================
  Coverage   99.86%   99.86%           
=======================================
  Files          28       28           
  Lines        3607     3607           
  Branches      265      265           
=======================================
  Hits         3602     3602           
  Misses          3        3           
  Partials        2        2           
Flag Coverage Δ
CI-GHA 99.86% <100.00%> (ø)
pytest 99.86% <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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Apr 22, 2026

Looks like we are missing pyupgrade on this repo

@Vizonex
Copy link
Copy Markdown
Member Author

Vizonex commented Apr 22, 2026

Looks like we are missing pyupgrade on this repo

@bdraco do you have any ideas of how we should go about doing something like that? I was thinking about implementing a few flags within ruff to get something like that to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants