Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🐛 Fix evaluating stringified annotations in Python 3.10 (also from __future__ import annotations)#721

Merged
tiangolo merged 4 commits into
fastapi:masterfrom
heckad:fix/allow-to-be-annotated-in-string
Mar 23, 2024
Merged

🐛 Fix evaluating stringified annotations in Python 3.10 (also from __future__ import annotations)#721
tiangolo merged 4 commits into
fastapi:masterfrom
heckad:fix/allow-to-be-annotated-in-string

Conversation

@heckad

@heckad heckad commented Dec 19, 2023

Copy link
Copy Markdown
Contributor

Fix case when annotated type inside string or from __future__ import annotations used.

@heckad heckad force-pushed the fix/allow-to-be-annotated-in-string branch from 928cca6 to 665786e Compare December 19, 2023 09:17
@heckad heckad force-pushed the fix/allow-to-be-annotated-in-string branch from 5a8b415 to f133a9e Compare December 19, 2023 09:19

@svlandeg svlandeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct to me, and the PR is related to earlier discussions #684 and #598.

I could replicate the issue with Python 3.10 and the fix from this PR indeed seems to resolve it.

@svlandeg svlandeg added bug Something isn't working p2 labels Feb 28, 2024
@tiangolo tiangolo changed the title Add eval_str to inspect.signature 🐛 Fix evaluating stringified annotations in Python 3.10 (also from __future__ import annotations) Mar 23, 2024
@tiangolo

Copy link
Copy Markdown
Member

Awesome, thanks @heckad! 🚀

And thank you @svlandeg for the help! 🙇

This will be available in Typer 0.9.3, released in the next few hours. 🚀

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

Labels

bug Something isn't working p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants