Skip to content

🎨 Upgrade typing syntax for Python 3.10 - #14932

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

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

Conversation

@tiangolo

Copy link
Copy Markdown
Member

🎨 Upgrade typing syntax for Python 3.10

@github-actions github-actions Bot added the internal Internal changes label Feb 17, 2026
@github-actions

github-actions Bot commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

📝 Docs preview

Last commit e03019e at: https://dd557bfc.fastapitiangolo.pages.dev

@codspeed-hq

codspeed-hq Bot commented Feb 17, 2026

Copy link
Copy Markdown

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
Copy Markdown
Member Author

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

Copilot AI commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

@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] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tiangolo <1326112+tiangolo@users.noreply.github.com>
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
Copy Markdown

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
Copy Markdown
Member

@joselu103, thanks for reporting!
See #14939

@Gerum-Berhanu

Gerum-Berhanu commented Aug 8, 2026

Copy link
Copy Markdown

Still seeing the outdated "Union in Python 3.10" text on the live Extra Models page. This PR looks ready (approved + mergeable). Happy to open a fresh replacement PR if that would help.

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

Labels

internal Internal changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants