tfdocs.doc_generator_visitor.maybe_singleton

Returns True if py_object might be a singleton value .

Many immutable values in python act like singletons: small ints, some strings, Bools, None, the empty tuple.

We can't rely on looking these up by their id() to find their name or duplicates.

This function checks if the object is one of those maybe singleton values.

py_object the object to check.

A bool, True if the object might be a singleton.