관리-도구
편집 파일: _version_info.cpython-37.opt-1.pyc
B �T�^r � @ sd d dl mZmZmZ d dlmZ ddlmZ ddlm Z m Z ee ddddd�G d d � d e���ZdS )� )�absolute_import�division�print_function)�total_ordering� )�astuple)�attrib�attrsFT)�eq�order�slots�frozenc @ s\ e Zd ZdZeed�Zeed�Zeed�Zee d�Z edd� �Zdd� Z dd� Zd d � ZdS )�VersionInfoa� 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 )�typec C sL |� d�}t|�dkr |�d� | t|d �t|d �t|d �|d d�S )z6 Parse *s* and return a _VersionInfo. �.� �finalr r � )�year�minor�micro�releaselevel)�split�len�append�int)�cls�s�v� r �C/opt/alt/python37/lib/python3.7/site-packages/attr/_version_info.py�_from_version_string% s z VersionInfo._from_version_stringc C sX | j |j krt|�}t|t�s"t�dt|� kr:dks@n t�t| �dt|�� |fS )z� 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*. r � N)� __class__r � isinstance�tuple�NotImplementedErrorr )�self�otherr r r � _ensure_tuple2 s zVersionInfo._ensure_tuplec C s0 y| � |�\}}W n tk r& tS X ||kS )N)r) r&