You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to define a generic model, then create a subclass of that generic model that both fills in the type parameter of the superclass, while introducing new type parameters. Here's a currently failing test case that illustrates the issue:
* Allow generics to extend concrete classes. fixes#2005
* Update the docs
* Updote the changes
* Convert double quotes to single quotes
* Fix formatting
* Add a check for data
* Update example
* Add a skip_36 decorator that got accidentally deleted when resolving conflicts.
Checks
Feature Request
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:I'd like to be able to define a generic model, then create a subclass of that generic model that both fills in the type parameter of the superclass, while introducing new type parameters. Here's a currently failing test case that illustrates the issue:
Currently that test case fails with
TypeError: Cannot parameterize a concrete instantiation of a generic model
This happens because
GenericBaseModel[int].__concrete__
gets set toTrue
, andGenericSub
inherits it.This can easily be fixed with the following change to
generics.py
:Should become
The text was updated successfully, but these errors were encountered: