@classmethod
def from_str(cls, string):
    """
		Create a local version specifier from a PEP440-compliant local version
		string.

		:param str string: A PEP440-compliant local version string
		"""
    if not cls.EXPRESSION.fullmatch(string):
        raise ValueError(f'{string!r} is not a valid local version specifier')
    segments = []
    for segment in cls._SEPARATOR_EXPRESSION.split(string.strip()):
        try:
            segments.append(int(segment))
        except ValueError:
            segments.append(segment)
    return cls(segments=segments)
