Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def repr(self, x, level=None):
if level is None:
level = self.maxlevel
for cls in inspect.getmro(correct_type(x)):
if cls in supressed_classes:
return basic_repr(x)[:-1] + ' (expensive repr suppressed)>'
func = repr_registry.get(cls)
if func:
return func(x, ReprHelper(self, level, func))
raise AssertionError