MCPcopy Create free account
hub / github.com/ipython/ipython / for_type

Function for_type

IPython/lib/pretty.py:791–799  ·  view source on GitHub ↗

Add a pretty printer for a given type.

(typ, func)

Source from the content-addressed store, hash-verified

789}
790
791def for_type(typ, func):
792 """
793 Add a pretty printer for a given type.
794 """
795 oldfunc = _type_pprinters.get(typ, None)
796 if func is not None:
797 # To support easy restoration of old pprinters, we need to ignore Nones.
798 _type_pprinters[typ] = func
799 return oldfunc
800
801def for_type_by_name(type_module, type_name, func):
802 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected