U afI@sNddlmZddlmZddlmZmZeedddddGdd d Zd S) )total_ordering)astuple)attribattrsFT)eqorderslotsfrozenc@s\eZdZdZeedZeedZeedZee dZ e ddZ ddZ ddZd d Zd S) 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 )typecCsL|d}t|dkr |d|t|dt|dt|d|ddS)z6 Parse *s* and return a _VersionInfo. .finalrr)yearminormicro releaselevel)splitlenappendint)clssvrC/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/attr/_version_info.py_from_version_string&s    z VersionInfo._from_version_stringcCsX|j|jkrt|}t|ts"tdt|kr:dks@ntt|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*. rN) __class__r isinstancetupleNotImplementedErrorr)selfotherrrr _ensure_tuple3s  zVersionInfo._ensure_tuplecCs4z||\}}Wntk r*tYSX||kSNr&r#NotImplementedr$r%usZthemrrr__eq__Fs  zVersionInfo.__eq__cCs4z||\}}Wntk r*tYSX||kSr'r(r*rrr__lt__Ns  zVersionInfo.__lt__N)__name__ __module__ __qualname____doc__rrrrrstrr classmethodrr&r,r-rrrrr s     r N) functoolsrZ_funcsr_makerrr rrrrs