Skip to content

Commit b26c4f6

Browse files
committed
Expose import items in top level init file
1 parent 6257f26 commit b26c4f6

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed

src/pystructtype/__init__.py

+40-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,43 @@
1-
# XXX: This is how class decorators essentially work
1+
from pystructtype.bitstype import BitsType, bits
2+
from pystructtype.structdataclass import StructDataclass, struct_dataclass
3+
from pystructtype.structtypes import (
4+
TypeInfo,
5+
TypeMeta,
6+
char_t,
7+
double_t,
8+
float_t,
9+
int8_t,
10+
int16_t,
11+
int32_t,
12+
int64_t,
13+
uint8_t,
14+
uint16_t,
15+
uint32_t,
16+
uint64_t,
17+
)
18+
19+
__all__ = [
20+
"BitsType",
21+
"StructDataclass",
22+
"TypeInfo",
23+
"TypeMeta",
24+
"bits",
25+
"char_t",
26+
"double_t",
27+
"float_t",
28+
"int8_t",
29+
"int16_t",
30+
"int32_t",
31+
"int64_t",
32+
"struct_dataclass",
33+
"uint8_t",
34+
"uint16_t",
35+
"uint32_t",
36+
"uint64_t",
37+
]
38+
39+
# Note: This is how class decorators essentially work
40+
#
241
# @foo
342
# class gotem(): ...
443
#

test/test_ctypes.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from typing import Annotated
22

3-
from pystructtype.bitstype import BitsType, bits
4-
from pystructtype.structdataclass import StructDataclass, struct_dataclass
5-
from pystructtype.structtypes import TypeMeta, uint8_t
3+
from pystructtype import BitsType, StructDataclass, TypeMeta, bits, struct_dataclass, uint8_t
64

75
from .examples import TEST_CONFIG_DATA, SMXConfigType # type: ignore
86

0 commit comments

Comments
 (0)