$17 GRAYBYTE WORDPRESS FILE MANAGER $90

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/attr/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/attr//_version_info.py
# SPDX-License-Identifier: MIT


from functools import total_ordering

from ._funcs import astuple
from ._make import attrib, attrs


@total_ordering
@attrs(eq=False, order=False, slots=True, frozen=True)
class VersionInfo:
    """
    A version object that can be compared to tuple of length 1--4:

    >>> attr.VersionInfo(19, 1, 0, "final")  <= (19, 2)
    True
    >>> attr.VersionInfo(19, 1, 0, "final") < (19, 1, 1)
    True
    >>> vi = attr.VersionInfo(19, 2, 0, "final")
    >>> vi < (19, 1, 1)
    False
    >>> vi < (19,)
    False
    >>> vi == (19, 2,)
    True
    >>> vi == (19, 2, 1)
    False

    .. versionadded:: 19.2
    """

    year = attrib(type=int)
    minor = attrib(type=int)
    micro = attrib(type=int)
    releaselevel = attrib(type=str)

    @classmethod
    def _from_version_string(cls, s):
        """
        Parse *s* and return a _VersionInfo.
        """
        v = s.split(".")
        if len(v) == 3:
            v.append("final")

        return cls(
            year=int(v[0]), minor=int(v[1]), micro=int(v[2]), releaselevel=v[3]
        )

    def _ensure_tuple(self, other):
        """
        Ensure *other* is a tuple of a valid length.

        Returns a possibly transformed *other* and ourselves as a tuple of
        the same length as *other*.
        """

        if self.__class__ is other.__class__:
            other = astuple(other)

        if not isinstance(other, tuple):
            raise NotImplementedError

        if not (1 <= len(other) <= 4):
            raise NotImplementedError

        return astuple(self)[: len(other)], other

    def __eq__(self, other):
        try:
            us, them = self._ensure_tuple(other)
        except NotImplementedError:
            return NotImplemented

        return us == them

    def __lt__(self, other):
        try:
            us, them = self._ensure_tuple(other)
        except NotImplementedError:
            return NotImplemented

        # Since alphabetically "dev0" < "final" < "post1" < "post2", we don't
        # have to do anything special with releaselevel for now.
        return us < them

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
17 Dec 2025 3.08 AM
root / root
0755
__pycache__
--
14 Aug 2025 9.25 PM
root / root
0755
__init__.py
3.165 KB
17 Apr 2025 8.10 PM
root / root
0644
__init__.pyi
17.196 KB
17 Apr 2025 8.10 PM
root / root
0644
_cmp.py
4.002 KB
17 Apr 2025 8.10 PM
root / root
0644
_cmp.pyi
0.39 KB
17 Apr 2025 8.10 PM
root / root
0644
_compat.py
5.667 KB
17 Apr 2025 8.10 PM
root / root
0644
_config.py
0.807 KB
17 Apr 2025 8.10 PM
root / root
0644
_funcs.py
16.338 KB
17 Apr 2025 8.10 PM
root / root
0644
_make.py
94.706 KB
17 Apr 2025 8.10 PM
root / root
0644
_next_gen.py
6.124 KB
17 Apr 2025 8.10 PM
root / root
0644
_typing_compat.pyi
0.458 KB
17 Apr 2025 8.10 PM
root / root
0644
_version_info.py
2.071 KB
17 Apr 2025 8.10 PM
root / root
0644
_version_info.pyi
0.204 KB
17 Apr 2025 8.10 PM
root / root
0644
converters.py
3.518 KB
17 Apr 2025 8.10 PM
root / root
0644
converters.pyi
0.396 KB
17 Apr 2025 8.10 PM
root / root
0644
exceptions.py
1.846 KB
17 Apr 2025 8.10 PM
root / root
0644
exceptions.pyi
0.526 KB
17 Apr 2025 8.10 PM
root / root
0644
filters.py
1.436 KB
17 Apr 2025 8.10 PM
root / root
0644
filters.pyi
0.22 KB
17 Apr 2025 8.10 PM
root / root
0644
py.typed
0 KB
17 Apr 2025 8.10 PM
root / root
0644
setters.py
1.367 KB
17 Apr 2025 8.10 PM
root / root
0644
setters.pyi
0.554 KB
17 Apr 2025 8.10 PM
root / root
0644
validators.py
20.217 KB
17 Apr 2025 8.10 PM
root / root
0644
validators.pyi
2.52 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF