core: add type inference for bytes/bytearray (have to fix later)
This commit is contained in:
parent
7cfcab44e5
commit
a767c9cc7e
|
@ -246,6 +246,9 @@ PossibleType = U[Type, list, tuple, Callable[[O[Any]], Type]]
|
|||
def to_type(type: PossibleType, ident: O[Any] = None) -> Type:
|
||||
if isinstance(type, Type):
|
||||
return type
|
||||
if isinstance(type, (bytes, bytearray)):
|
||||
from sx.types.data import Data
|
||||
return Data()
|
||||
t = getattr(type, '_sx_type_', None)
|
||||
if t:
|
||||
return t
|
||||
|
|
Loading…
Reference in New Issue