Пример #1
0
 def _repr_pretty_(self, p, cycle):
     from IPython.lib.pretty import _dict_pprinter_factory
     fn = _dict_pprinter_factory('{', '}')
     excluded_fields = {
         '_enable_surrogate', '_attr', '_parent', '_surrogate'
     }
     fn(keyfilter(lambda k: k not in excluded_fields, self.__dict__), p,
        cycle)
Пример #2
0
 def _repr_pretty_(self, p, cycle):
     from IPython.lib.pretty import _dict_pprinter_factory
     fn = _dict_pprinter_factory('ConfiguredProperties {', '}')
     fn(self._conf_dict, p, cycle)
Пример #3
0
 def _repr_pretty_(self, p, cycle):
     from IPython.lib.pretty import _dict_pprinter_factory
     fn = _dict_pprinter_factory('{', '}')
     excluded_fields = {'_enable_surrogate', '_attr', '_parent', '_surrogate'}
     fn(keyfilter(lambda k: k not in excluded_fields, self.__dict__), p, cycle)
Пример #4
0
 def _repr_pretty_(self, p, cycle):
     from IPython.lib.pretty import _dict_pprinter_factory
     fn = _dict_pprinter_factory('ConfiguredProperties {', '}')
     fn(self._conf_dict, p, cycle)
Пример #5
0
    def _repr_pretty_(self, p, cycle):
        from IPython.lib.pretty import _dict_pprinter_factory

        pprinter = _dict_pprinter_factory(f"{type(self).__name__}({{", "})")
        return pprinter(self, p, cycle)