do not overwrite builtin Python types in __all__

This commit is contained in:
Shiz 2022-05-10 13:29:42 +02:00
parent 1ecf946341
commit 2ed6f90f0e
2 changed files with 7 additions and 4 deletions

View File

@ -7,13 +7,13 @@ del core
from .types.data import Nothing, Implied, Ignored, Pad, Data, data, Bits, bit, nibble
from .types.num import (
Bool, Int, Float, bool, int8, uint8, byte,
Bool, Int, Float, bool8, int8, uint8, byte,
int16, uint16, int16be, int16le, uint16be, uint16le, word,
int32, uint32, int32be, int32le, uint32be, uint32le, dword,
int64, uint64, int64be, int64le, uint64be, uint64le, qword,
intbe, intle, uintbe, uintle,
float16, float16le, float16be, binary16, binary16le, binary16be, half,
float32, float32le, float32be, binary32, binary32le, binary32be, float_,
float32, float32le, float32be, binary32, binary32le, binary32be,
float64, float64le, float64be, binary64, binary64le, binary64be, double,
)
from .types.str import Str, CStr, cstr, wcstr, utf8cstr, utf16cstr
@ -29,3 +29,7 @@ Static = Calc = Implied
Transform = Proc
__all__ = [k for k in globals() if not k.startswith('_')]
# Extra types that shouldn't pollute the namespace they're mass-imported into
bool = bool8
float = float32

View File

@ -89,7 +89,7 @@ class Bool(G[T], Mapped[T, bool]):
repr=f'<{__name__}.Bool({child!r}, true: {true_value!r}, false: {false_value!r})>',
)
bool = Bool(uint8)
bool8 = Bool(uint8)
class Float(Type[float]):
@ -134,7 +134,6 @@ float16le = \
binary16le = Float(16, endian=Endian.Little)
float16be = \
binary16be = Float(16, endian=Endian.Big)
float_ = \
float32 = \
binary32 = \
float32le = \