Merge pull request
#4561 from minrk/for_type_clear...
Merge pull request
#4561 from minrk/for_type_clear
Copied some of the logic from apptools (thanks @rkern).
The current behavior:
- `lookup(instance)` - return appropriate callback or a given object
- `lookup_by_type(type_or_str)` - return appropriate callback for a given type or `'mod.name'` type string
- `for_type(type_or_str)` - behaves the same, only adding support for type strings for consistency
- `pop(type_or_str[, default])` - remove a type (by type or string)
- `typ_or_str in Formatter` checks whether a type is registered, checking with `lookup_by_type`
The inner structures remain unchanged.