Add a pretty printer for a given type.
(typ, func)
| 789 | } |
| 790 | |
| 791 | def 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 | |
| 801 | def for_type_by_name(type_module, type_name, func): |
| 802 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected