Skip to content

Commit 1c718fc

Browse files
MarkDaoustcopybara-github
authored andcommitted
Strip dict methods from subclass pages.
This will clear a bunch of noise from pages like: https://developers.generativeai.google/api/python/google/generativeai/types/SafetySettingDict PiperOrigin-RevId: 535472732
1 parent b6b50f5 commit 1c718fc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tools/tensorflow_docs/api_generator/pretty_docs/class_page.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,18 @@ def collect_docs(self):
353353

354354
class_path_node = self.parser_config.path_tree[self.api_node.path]
355355
for _, path_node in sorted(class_path_node.children.items()):
356-
# Don't document anything that is defined in object or by protobuf.
356+
# TODO(b/284321463): This should go in the `traverse` function.
357+
# Don't document anything that is defined in common builtin types.
357358
defining_class = parser.get_defining_class(py_class, path_node.short_name)
358-
if defining_class in [object, type, tuple, BaseException, Exception]:
359+
if defining_class in [
360+
object,
361+
type,
362+
tuple,
363+
dict,
364+
list,
365+
BaseException,
366+
Exception,
367+
]:
359368
continue
360369

361370
# The following condition excludes most protobuf-defined symbols.

0 commit comments

Comments
 (0)