1 � 355ÆÅÄ c
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
$ ˆl–äY>”ŠC]Š‚fãN\ªbѿà „oº×ÂÆÅ >f # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import collections import itertools import re import warnings from ._structures import Infinity, NegativeInfinity from ._typing import TYPE_CHECKING if TYPE_CHECKING: # pragma: no cover from typing import Callable, Iterator, List, Optional, SupportsInt, Tuple, Union from ._structures import InfinityType, NegativeInfinityType InfiniteTypes = Union[InfinityType, NegativeInfinityType] PrePostDevType = Union[InfiniteTypes, Tuple[str, int]] SubLocalType = Union[InfiniteTypes, int, str] LocalType = Union[ NegativeInfinityType, Tuple[ Union[ SubLocalType, Tuple[SubLocalType, str], Tuple[NegativeInfinityType, SubLocalType], ], ..., ], ] CmpKey = Tuple[ int, Tuple[int, ...], PrePostDevType, PrePostDevType, PrePostDevType, LocalType ] LegacyCmpKey = Tuple[int, Tuple[str, ...]] VersionComparisonMethod = Callable[ [Union[CmpKey, LegacyCmpKey], Union[CmpKey, LegacyCmpKey]], bool ] __all__ = ["parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION_PATTERN"] _Version = collections.namedtuple( "_Version", ["epoch", "release", "dev", "pre", "post", "local"] ) def parse(version): # type: (str) -> Union[LegacyVersion, Version] """ Parse the given version string and return either a :class:`Version` object or a :class:`LegacyVersion` object depending on if the given version is a valid PEP 440 version or a legacy version. """ try: return Version(version) except InvalidVersion: return LegacyVersion(version) class InvalidVersion(ValueError): """ An invalid version was found, users should refer to PEP 440. """ class _BaseVersion(object): _key = None # type: Union[CmpKey, LegacyCmpKey] def __hash__(self): # type: () -> int return hash(self._key) # Please keep the duplicated `isinstance` check # in the six comparisons hereunder # unless you find a way to avoid adding overhead function calls. def __lt__(self, other): # type: (_BaseVersion) -> bool if not isinstance(other, _BaseVersion): return NotImplemented return self._key < other._key def __le__(self, other): # type: (_BaseVersion) -> bool if not isinstance(other, _BaseVersion): return NotImplemented return self._key <= other._key def __eq__(self, other): # type: (object) -> bool if not isinstance(other, _BaseVersion): return NotImplemented return self._key == other._key def __ge__(self, other): # type: (_BaseVersion) -> bool if not isinstance(other, _BaseVersion): return NotImplemented return self._key >= other._key def __gt__(self, other): # type: (_BaseVersion) -> bool if not isinstance(other, _BaseVersion): return NotImplemented return self._key > other._key def __ne__(self, other): # type: (object) -> bool if not isinstance(other, _BaseVersion): return NotImplemented return self._key != other._key class LegacyVersion(_BaseVersion): def __init__(self, version): # type: (str) -> None self._version = str(version) self._key = _legacy_cmpkey(self._version)