Skip to content

Commit 8325ca7

Browse files
Fix error when py_object has custom __eq__
PiperOrigin-RevId: 414969859
1 parent b7facac commit 8325ca7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/tensorflow_docs/api_generator/doc_generator_visitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def maybe_singleton(py_object: Any) -> bool:
4545
is_immutable_type = isinstance(py_object, immutable_types)
4646

4747
# Check if the object is the empty tuple.
48-
return is_immutable_type or py_object == ()
48+
return is_immutable_type or (isinstance(py_object, tuple) and py_object == ()) # pylint: disable=g-explicit-bool-comparison
4949

5050

5151
class ApiTreeNode(object):

0 commit comments

Comments
 (0)