-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
ensure cythonized functions are left untouched2 #2228
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2228 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 4426 4426
Branches 888 888
=========================================
Hits 4426 4426 Continue to review full report at Codecov.
|
78d84ba to
41c0cb6
Compare
pydantic/main.py
Outdated
| @@ -242,6 +242,11 @@ def __new__(mcs, name, bases, namespace, **kwargs): # noqa C901 | |||
|
|
|||
| prepare_config(config, name) | |||
|
|
|||
| untouched_types = UNTOUCHED_TYPES | |||
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.
So it doesn't take into account config.untouched_types anymore?
Could be good to add a cached_property or something in the test
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.
it does because untouched_types is changed on line 253. I think this should keep the existing functionality except for cython behaviour.
But to be honest this is going to conflict a lot with #2094 anyway. Hopefully I can wait for that to be merged, then I'll amend this PR.
Happy new year! Thanks so much for all your support on pydantic in 2020.
If we're ever at the same conference (once conferences happen again :-() we should make an effort to meet in person.
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.
Ah right I went too fast over the patch and didn't read the whole file sorry
I'll work on #2094 tomorrow. Thanks for your kind message
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.
Probably useful to link the closed issue in the description.
Happy new year!
Change Summary
Compiling code with pydantic models with cython doesn't work well because type annotations are currently stripped (see #1162), but in limited situations it can be made to work.
This fixes a problem with compiled functions not being skipped while creating models.
Related issue number
supersedes #1944
fixes #1943
Checklist
changes/<pull request or issue id>-<github username>.mdfile added describing change(see changes/README.md for details)