Skip to content

Commit

Permalink
Add description for the _assigned_parameters variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
diabolo-dan committed May 17, 2021
1 parent 5ef79e8 commit 9f1d7ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pydantic/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
TypeVarType = Any # since mypy doesn't allow the use of TypeVar as a type

Parametrization = Mapping[TypeVarType, Type[Any]]

# _assigned_parameters is a Mapping from parametrized version of generic models to assigned types of parametrizations
# as captured during construction of the class (not instances).
# E.g., for generic model `Model[A, B]`, when parametrized model `Model[int, str]` is created,
# `Model[int, str]`: {A: int, B: str}` will be stored in `_assigned_parameters`.
# (This information is only otherwise available after creation from the class name string).
_assigned_parameters: Dict[Type[Any], Parametrization] = {}


Expand Down

0 comments on commit 9f1d7ab

Please sign in to comment.