docs: def _check_mapper(self, mapper):
          """ Check that the mapper has valid signature. """
          if not hasattr(mapper, 'parse') or not callable(mapper.parse):
              raise ValueError('mapper must implement parse()')
          if not hasattr(mapper, 'format') or not callable(mapper.format):
              raise ValueError('mapper must implement format()')