Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Add experimental support for free threading#11516
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Similar logic to the recursion state
Nothing we can really do on these ones, the `generate_schema_calls`fixture monkeypatches code and this will happen across threads.
cloudflare-workers-and-pagesbot commentedMar 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Deploying pydantic-docs with |
Latest commit: | 03d03fd |
Status: | ✅ Deploy successful! |
Preview URL: | https://fdfb6bc1.pydantic-docs.pages.dev |
Branch Preview URL: | https://freethreaded.pydantic-docs.pages.dev |
codspeed-hqbot commentedMar 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#11516 willnot alter performanceComparing Summary
|
@@ -2149,6 +2150,7 @@ class Yard(BaseModel): | |||
assert str(yard_dict['pet']['type']) == 'dog' | |||
@pytest.mark.thread_unsafe(reason='Passes on multithreaded. This needs to be investigated further.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
While all the other tests marked as thread unsafe made sense, I have no idea why this one passes. Core schemas are identical, and verified it isn't a late lambda binding issue. Might be something in core?
github-actionsbot commentedMar 4, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Coverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Overall LGTM with one question!
@@ -94,7 +94,7 @@ def __delitem__(self, key: KT) -> None: | |||
# and discover later on that we need to re-add all this infrastructure... | |||
# _GENERIC_TYPES_CACHE = DeepChainMap(GenericTypesCache(), LimitedDict()) | |||
_GENERIC_TYPES_CACHE = GenericTypesCache() | |||
_GENERIC_TYPES_CACHE: ContextVar[GenericTypesCache | None] = ContextVar('_GENERIC_TYPES_CACHE', default=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The idea here is to make a separate cache for each thread?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes exactly, identical to the recursion cache:
pydantic/pydantic/_internal/_generics.py
Line 396 inbff7477
_generic_recursion_cache:ContextVar[set[str]|None]=ContextVar('_generic_recursion_cache',default=None) |
Makes sense to get this into the 2nd beta next week 👍 |
10af6a8
intomainUh oh!
There was an error while loading.Please reload this page.
Change Summary
Fixes#10483.
Related issue number
Checklist