Skip to content

Commit b6898b4

Browse files
[Misc] Add __all__ in __init__.py. (#478)
This PR adds __all__ in __init__.py to constrain the imported objects. Signed-off-by: Yuchuan <[email protected]>
1 parent 8bf3651 commit b6898b4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

python/xgrammar/__init__.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,32 @@
2525
)
2626
from .structural_tag import StructuralTag
2727
from .tokenizer_info import TokenizerInfo, VocabType
28+
29+
__all__ = [
30+
"exception",
31+
"structural_tag",
32+
"testing",
33+
"CompiledGrammar",
34+
"GrammarCompiler",
35+
"get_max_recursion_depth",
36+
"get_serialization_version",
37+
"max_recursion_depth",
38+
"set_max_recursion_depth",
39+
"hf",
40+
"DeserializeFormatError",
41+
"DeserializeVersionError",
42+
"InvalidJSONError",
43+
"InvalidStructuralTagError",
44+
"Grammar",
45+
"StructuralTagItem",
46+
"BatchGrammarMatcher",
47+
"GrammarMatcher",
48+
"allocate_token_bitmask",
49+
"apply_token_bitmask_inplace",
50+
"bitmask_dtype",
51+
"get_bitmask_shape",
52+
"reset_token_bitmask",
53+
"StructuralTag",
54+
"TokenizerInfo",
55+
"VocabType",
56+
]

0 commit comments

Comments
 (0)