Skip to content

🎨 Upgrade typing syntax for Python 3.10#14932

Merged
tiangolo merged 3 commits intomasterfrom
modern-types
Feb 17, 2026
Merged

🎨 Upgrade typing syntax for Python 3.10#14932
tiangolo merged 3 commits intomasterfrom
modern-types

Conversation

@tiangolo
Copy link
Member

🎨 Upgrade typing syntax for Python 3.10

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 17, 2026

Merging this PR will not alter performance

✅ 20 untouched benchmarks


Comparing modern-types (e03019e) with master (bbb96d4)1

Open in CodSpeed

Footnotes

  1. No successful run was found on master (6e5680c) during the generation of this report, so bbb96d4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@tiangolo
Copy link
Member Author

@copilot can you add or extend tests to fix coverage here?

Copy link
Contributor

Copilot AI commented Feb 17, 2026

@tiangolo I've opened a new pull request, #14933, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 17, 2026 10:37
…4933)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: tiangolo <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the docs Documentation about how to use FastAPI label Feb 17, 2026
@tiangolo tiangolo removed the docs Documentation about how to use FastAPI label Feb 17, 2026
@tiangolo tiangolo enabled auto-merge (squash) February 17, 2026 09:59
@tiangolo tiangolo merged commit faee822 into master Feb 17, 2026
40 of 41 checks passed
@tiangolo tiangolo deleted the modern-types branch February 17, 2026 09:59
@joselu103
Copy link

Hi, I was reading the tutorial and noticed that in the "Union or anyof" section the example uses:

@app.get("/items/{item_id}", response_model=PlaneItem | CarItem)

However, in the next section it says:

In this example we pass Union[PlaneItem, CarItem] as the value of the argument response_model.
Because we are passing it as a value to an argument instead of putting it in a type annotation, we have to use Union even in Python 3.10.

Is it possible that this second section wasn’t updated?

Please let me know if this would be better reported elsewhere.

@YuriiMotov
Copy link
Member

@joselu103, thanks for reporting!
See #14939

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants