parameters: (self, typ)
docstring: Look up the registered formatter for a type.
  
          Parameters
          ----------
          typ  : type or '__module__.__name__' string for a type
  
          Returns
          -------
          f : callable
              The registered formatting callable for the type.
  
          Raises
          ------
          KeyError if the type has not been registered.
docstring_summary: Look up the registered formatter for a type.
docstring_tokens: Look up the registered formatter for a type .
function: def lookup_by_type(self, typ):
          """Look up the registered formatter for a type.
  
          Parameters
          ----------
          typ  : type or '__module__.__name__' string for a type
  
          Returns
          -------
          f : callable
              The registered formatting callable for the type.
  
          Raises
          ------
          KeyError if the type has not been registered.
          """
          if isinstance(typ, str):
              typ_key = tuple(typ.rsplit('.',1))
              if typ_key not in self.deferred_printers:
                  # We may have it cached in the type map. We will have to
                  # iterate over all of the types to check.
                  for cls in self.type_printers:
                      if _mod_name_key(cls) == typ_key:
                          return self.type_printers[cls]
              else:
                  return self.deferred_printers[typ_key]
          else:
              for cls in pretty._get_mro(typ):
                  if cls in self.type_printers or self._in_deferred_types(cls):
                      return self.type_printers[cls]
          
          # If we have reached here, the lookup failed.
          raise KeyError("No registered printer for {0!r}".format(typ))
function_tokens: def lookup_by_type ( self , typ ) : if isinstance ( typ , str ) : typ_key = tuple ( typ . rsplit ( '.' , 1 ) ) if typ_key not in self . deferred_printers : # We may have it cached in the type map. We will have to # iterate over all of the types to check. for cls in self . type_printers : if _mod_name_key ( cls ) == typ_key : return self . type_printers [ cls ] else : return self . deferred_printers [ typ_key ] else : for cls in pretty . _get_mro ( typ ) : if cls in self . type_printers or self . _in_deferred_types ( cls ) : return self . type_printers [ cls ] # If we have reached here, the lookup failed. raise KeyError ( "No registered printer for {0!r}" . format ( typ ) )