Skip to content
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

Support user defined generic field types in generic models for python < 3.9. #2554

Conversation

daviskirk
Copy link
Contributor

Add support for user defined generic type fields in generic models for python < 3.9.

Referencing this comment (and the problem described) here: #2465 (comment)

Change Summary

The actual change (the check for type_.name_) is not necessary in python >= 3.9 as described in the code comment but is needed for python < 3.9.

Related issue number

Work on #2465 (see comments)

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)

@daviskirk daviskirk changed the title Support user defined generic field types in generic models. Support user defined generic field types in generic models for python < 3.9. Mar 20, 2021
@codecov
Copy link

codecov bot commented Mar 20, 2021

Codecov Report

Merging #2554 (661c3b3) into master (7b7e705) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 661c3b3 differs from pull request most recent head 6c95fe1. Consider uploading reports for the commit 6c95fe1 to get more accurate results

@@            Coverage Diff            @@
##            master     #2554   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines         5109      5109           
  Branches      1050      1050           
=========================================
  Hits          5109      5109           
Impacted Files Coverage Δ
pydantic/generics.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4753901...6c95fe1. Read the comment docs.

pydantic/generics.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
pydantic/generics.py Outdated Show resolved Hide resolved
@daviskirk daviskirk force-pushed the support-user-defined-generic-fields-for-generic-models branch 2 times, most recently from 213500a to 661c3b3 Compare March 25, 2021 12:45
@daviskirk daviskirk force-pushed the support-user-defined-generic-fields-for-generic-models branch from 661c3b3 to 38dce40 Compare April 11, 2021 05:05
@daviskirk
Copy link
Contributor Author

Rebased on master to fix tests

@samuelcolvin samuelcolvin merged commit e3b98a1 into pydantic:master May 9, 2021
@samuelcolvin
Copy link
Member

thanks so much.

samuelcolvin added a commit that referenced this pull request May 11, 2021
Work on #2465 (see comments)

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants