Closed GertBurger closed 3 years ago
Do you have examples of builtin types that aren't displayed? Note that safe_repr doesn't support subclasses of builtins due to the inherent unsafety of isinstance (it would trigger whatever descriptor is on __class__
unfortunately). Also see this.
Hunter could have a almost_safe_repr
(that would work like the old repr that used isinstance and such) but I'd like to hear your usecase first.
Also, search for repr in https://python-hunter.readthedocs.io/en/latest/changelog.html to see how it evolved.
Right now the ones that I often long for are:
I guess one would have to verify that their repr()'s are suitable for inclusion into safe_repr()
though
Dully noted. Will add support for those.
ta, I don't mind doing the work if you are busy...
Sure, why not 🥳
@GertBurger I think this issue was solved via https://github.com/ionelmc/python-hunter/commit/63ed6fd3b35029eac198b859f013e8edf0c77586
Maybe you want to close it?
:+1:
I was wondering what the scope limitations for
safe_repr
is?Often I run into issues with builtin data types that are not rendered in a usable fashion and if having support for that falls within the scope of
safe_repr
or if the project's opinion is thatrepr_func
should be used.Clearly arbitrary and user defined objects should be handled by a repr func but does python builtins also fall in that category?