| 584 | |
| 585 | @classmethod |
| 586 | def _find_map_entry(cls, dtype): |
| 587 | # if a converter for the specific dtype is available use that |
| 588 | for i, (deftype, func, default_def) in enumerate(cls._mapper): |
| 589 | if dtype.type == deftype: |
| 590 | return i, (deftype, func, default_def) |
| 591 | |
| 592 | # otherwise find an inexact match |
| 593 | for i, (deftype, func, default_def) in enumerate(cls._mapper): |
| 594 | if np.issubdtype(dtype.type, deftype): |
| 595 | return i, (deftype, func, default_def) |
| 596 | |
| 597 | raise LookupError |
| 598 | |
| 599 | def __init__(self, dtype_or_func=None, default=None, missing_values=None, |
| 600 | locked=False): |