Skip to content

Commit 77980ce

Browse files
authored
Exclude auto-generated enum APIs from the stub (#1182)
I wasn't sure if I should add a test for this, because none of the current tests seem to run with --include-private.
1 parent 0f7fb41 commit 77980ce

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/stubgen.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,19 @@ class and repeatedly call ``.put()`` to register modules or contents within the
8484
else:
8585
typing_extensions = None
8686

87-
# Exclude various standard elements found in modules, classes, etc.
8887
SKIP_LIST = [
88+
# Various standard attributes found in modules, classes, etc.
8989
"__doc__", "__module__", "__name__", "__new__", "__builtins__",
9090
"__cached__", "__path__", "__version__", "__spec__", "__loader__",
9191
"__package__", "__nb_signature__", "__class_getitem__", "__orig_bases__",
9292
"__file__", "__dict__", "__weakref__", "__format__", "__nb_enum__",
9393
"__firstlineno__", "__static_attributes__", "__annotations__", "__annotate__",
94-
"__annotate_func__"
94+
"__annotate_func__",
95+
96+
# Auto-generated enum attributes. Type checkers synthesize these, so they
97+
# shouldn't appear in the stubs.
98+
"_new_member_", "_use_args_", "_member_names_", "_member_map_",
99+
"_value2member_map_", "_unhashable_values_", "_value_repr_",
95100
]
96101

97102
# Interpreter-internal types.

0 commit comments

Comments
 (0)