@classmethod
def __parse_pretty_field_def(cls, field_def):
    """Parses a single field definition

        Testing badly formatted field names

        >>> class MyObject(PrettyObject):
        ...     __pretty_fields__ = [
        ...         "a:<asdf",
        ...     ]
        ...     def __init__(self, a): self.a = a
        >>> obj = MyObject('test')
        >>> print(obj)
        Traceback (most recent call last):
        ...
        ValueError: Invalid format specifier
        """
    if '!' in field_def:
        field_def = field_def.split('!', 1)
        field_def[1] = '!' + field_def[1]
        return field_def
    if ':' in field_def:
        field_def = field_def.split(':', 1)
        field_def[1] = ':' + field_def[1]
        return field_def
    return field_def, '!r'
