merging
This commit is contained in:
commit
994b52d829
@ -445,7 +445,7 @@ class Var(Generic[VAR_TYPE]):
|
|||||||
|
|
||||||
if issubclass(output, NumberVar):
|
if issubclass(output, NumberVar):
|
||||||
if fixed_type is not None:
|
if fixed_type is not None:
|
||||||
if fixed_type is Union:
|
if fixed_type in types.UnionTypes:
|
||||||
inner_types = get_args(base_type)
|
inner_types = get_args(base_type)
|
||||||
if not all(issubclass(t, (int, float)) for t in inner_types):
|
if not all(issubclass(t, (int, float)) for t in inner_types):
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
@ -534,7 +534,7 @@ class Var(Generic[VAR_TYPE]):
|
|||||||
|
|
||||||
fixed_type = get_origin(var_type) or var_type
|
fixed_type = get_origin(var_type) or var_type
|
||||||
|
|
||||||
if fixed_type is Union:
|
if fixed_type in types.UnionTypes:
|
||||||
inner_types = get_args(var_type)
|
inner_types = get_args(var_type)
|
||||||
|
|
||||||
if all(
|
if all(
|
||||||
|
Loading…
Reference in New Issue
Block a user