Skip to content

Commit e4a6dd2

Browse files
committed
handle subtypevars in convertible_from
1 parent 61b391b commit e4a6dd2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fileformats/core/fileset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from typing_extensions import TypeAlias
2525

2626
from fileformats.core.typing import Self
27+
from fileformats.core.converter_helpers import SubtypeVar
2728
from fileformats.core.utils import _excluded_subpackages
2829

2930
from .classifier import Classifier
@@ -670,8 +671,6 @@ def convertible_from(
670671
671672
Parameters
672673
----------
673-
include_generic: bool
674-
If True, only consider parent classes in the same namespace for conversion.
675674
union_sort_key : callable[[DataType], Any], optional
676675
A function used to sort the union of types. Defaults to sorting by the type name.
677676
@@ -698,6 +697,8 @@ def add_concrete(datatype: ty.Type[DataType]) -> None:
698697
if inspect.isabstract(datatype):
699698
for subclass in datatype.subclasses():
700699
add_concrete(subclass)
700+
elif issubclass(datatype, SubtypeVar):
701+
concrete_datatypes.add(datatype.bound)
701702
else:
702703
concrete_datatypes.add(datatype)
703704

0 commit comments

Comments
 (0)