File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
tools/tensorflow_docs/api_generator Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -92,15 +92,20 @@ def _get_raw_docstring(py_object):
9292 obj_type = obj_type_lib .ObjType .get (py_object )
9393
9494 if obj_type is obj_type_lib .ObjType .TYPE_ALIAS :
95- if inspect .getdoc (py_object ) != inspect .getdoc (py_object .__origin__ ):
96- result = inspect .getdoc (py_object )
97- else :
95+ result = inspect .getdoc (py_object )
96+ if result == inspect .getdoc (py_object .__origin__ ):
9897 result = ''
9998 elif obj_type is obj_type_lib .ObjType .CLASS :
10099 if dataclasses .is_dataclass (py_object ):
101100 result = _get_dataclass_docstring (py_object )
102101 else :
103102 result = inspect .getdoc (py_object ) or ''
103+ if (
104+ result == inspect .getdoc (dict )
105+ or result == inspect .getdoc (list )
106+ or result == inspect .getdoc (tuple )
107+ ):
108+ result = ''
104109 elif obj_type is obj_type_lib .ObjType .OTHER :
105110 result = ''
106111 else :
You can’t perform that action at this time.
0 commit comments