use get origin more
This commit is contained in:
parent
1d45f70dfe
commit
777e8bc60e
@ -362,13 +362,9 @@ class ImmutableVar(Var, Generic[VAR_TYPE]):
|
|||||||
from .object import ObjectVar, ToObjectOperation
|
from .object import ObjectVar, ToObjectOperation
|
||||||
from .sequence import ArrayVar, StringVar, ToArrayOperation, ToStringOperation
|
from .sequence import ArrayVar, StringVar, ToArrayOperation, ToStringOperation
|
||||||
|
|
||||||
fixed_type = (
|
fixed_type = get_origin(var_type) or var_type
|
||||||
var_type
|
|
||||||
if var_type is None or inspect.isclass(var_type)
|
|
||||||
else get_origin(var_type)
|
|
||||||
)
|
|
||||||
|
|
||||||
fixed_output_type = output if inspect.isclass(output) else get_origin(output)
|
fixed_output_type = get_origin(output) or output
|
||||||
|
|
||||||
if fixed_output_type is dict:
|
if fixed_output_type is dict:
|
||||||
return self.to(ObjectVar, output)
|
return self.to(ObjectVar, output)
|
||||||
@ -444,7 +440,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]):
|
|||||||
if var_type is Any:
|
if var_type is Any:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
fixed_type = var_type if inspect.isclass(var_type) else get_origin(var_type)
|
fixed_type = get_origin(var_type) or var_type
|
||||||
|
|
||||||
if fixed_type is Union:
|
if fixed_type is Union:
|
||||||
return self
|
return self
|
||||||
|
Loading…
Reference in New Issue
Block a user