ensure cythonized functions are left untouched2#2228
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
|
|
||
| prepare_config(config, name) | ||
|
|
||
| untouched_types = UNTOUCHED_TYPES |
There was a problem hiding this comment.
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.
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.
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
PrettyWood
left a comment
There was a problem hiding this comment.
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)