Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport use of TypeVar on generic subclasses #842
Conversation
This comment has been minimized.
This comment has been minimized.
codecov
bot
commented
Sep 29, 2019
•
Codecov Report
@@ Coverage Diff @@
## master #842 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 17 17
Lines 3024 3024
Branches 582 582
=====================================
Hits 3024 3024 Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
@zpencerq Yes, I noticed recently that this also prevents you from using bounds to restrict the TypeVars in subclasses. Thanks for contributing this. You should be able to fix the formatting issues currently causing tests to fail by running You can also run a plain (More detail here: https://pydantic-docs.helpmanual.io/#contributing-to-pydantic) |
This comment has been minimized.
This comment has been minimized.
Should I open this against (or change base to) |
This comment has been minimized.
This comment has been minimized.
@zpencerq I think just against master is fine — I think @samuelcolvin is hoping to release a beta this week. |
2539835
into
samuelcolvin:master
This comment has been minimized.
This comment has been minimized.
thanks so much. |
zpencerq commentedSep 29, 2019
•
edited
This change was originally introduced to support generic functions on generic types defined for
pydantic
.Notably, passing a
TypeVar
on aGenericModel
subclass raises aTypeError
(presumably?) meant for assisting users in defining their generic model classes.Example:
Change Summary
TypeVar
onGenericModel
subclasses.Checklist
changes/<pull request or issue id>-<github username>.rst
file added describing change(see changes/README.md for details)