Skip to content

Commit

Permalink
Remove incorrect subclassing of partial.
Browse files Browse the repository at this point in the history
The type was incorrectly being picked up for this style of subclassing,
and it can be regardless inferred through cls.
  • Loading branch information
diabolo-dan committed Mar 22, 2021
1 parent d590708 commit adb7c8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pydantic/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ class B(A[V], Generic[V]):
# type is Generic or
# base model is already concrete, and will be included transitively.
continue
elif cls in _assigned_parameters and base_model in _assigned_parameters:
# Subclass will be inferred via cls
continue
else:
# print(f'{typevars_map}, {mapped_types}, {mapped_types}, {cls.__parameters__}, {base_model.__parameters__}')
base_parameters = tuple([mapped_types[param] for param in base_model.__parameters__])
result = base_model.__class_getitem__(base_parameters)
if result != base_model and result != cls:
Expand Down

0 comments on commit adb7c8e

Please sign in to comment.