I am having trouble understanding why the default __repr__
's implementation isn't more informative.
This answer on https://stackoverflow.com/a/2626364/3646408 states
having a default for repr which would act like:
return "%s(%r)" % (self.__class__, self.__dict__)
would have been too dangerous (for example, too easy to get into infinite recursion if objects reference each other).
Such case would be
instance = Class(); instance.attr = instance
This seems like more a mistake to me. What could be a valid use-case where this could happen?