File tree 1 file changed +8
-3
lines changed
tools/tensorflow_docs/api_generator
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):
92
92
obj_type = obj_type_lib .ObjType .get (py_object )
93
93
94
94
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__ ):
98
97
result = ''
99
98
elif obj_type is obj_type_lib .ObjType .CLASS :
100
99
if dataclasses .is_dataclass (py_object ):
101
100
result = _get_dataclass_docstring (py_object )
102
101
else :
103
102
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 = ''
104
109
elif obj_type is obj_type_lib .ObjType .OTHER :
105
110
result = ''
106
111
else :
You can’t perform that action at this time.
0 commit comments