How to use the birdseye.cheap_repr.ReprHelper function in birdseye

To help you get started, we’ve selected a few birdseye examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexmojaki / birdseye / birdseye / cheap_repr.py View on Github external
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