HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyo
�
�A�[c@ s�dZddlmZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
mZmZe
r�eZndefd��YZd	eee�fd
��YZd	gZdS(s�
Backport of Python 3's int, based on Py2's long.

They are very similar. The most notable difference is:

- representation: trailing L in Python 2 removed in Python 3
i����(tdivisionN(tnewbytes(t	newobject(tPY3tisinttistexttisbytestwith_metaclasstnativet
BaseNewIntcB seZd�ZRS(cC s3|tkrt|ttf�St|j|�SdS(N(tnewintt
isinstancetinttlongt
issubclasst	__class__(tclstinstance((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyt__instancecheck__s(t__name__t
__module__R(((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR	sR
cB s|eZdZddd�Zd�Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Z d!�Z!d"�Z"d#�Z#d$�Z$d%�Z%d&�Z&d'e'd(�Z(e)d'e'd)��Z*RS(*s6
    A backport of the Python 3 int object to Py2
    ii
cC siy|j�}Wntk
r)|}n+Xt|�sTtdjt|����n|dkr�t|�p�t|�p�t|t	�s�td��ny t
t|�j|||�SWq�tk
r�t
t|�j|t
|�|�SXnyt
t|�j||�SWnYtk
rdy#t
t|�j|t
|��SWqetdjt|����qeXnXdS(s.
        From the Py3 int docstring:

        |  int(x=0) -> integer
        |  int(x, base=10) -> integer
        |
        |  Convert a number or string to an integer, or return 0 if no
        |  arguments are given.  If x is a number, return x.__int__().  For
        |  floating point numbers, this truncates towards zero.
        |
        |  If x is not a number or if base is given, then x must be a string,
        |  bytes, or bytearray instance representing an integer literal in the
        |  given base.  The literal can be preceded by '+' or '-' and be
        |  surrounded by whitespace.  The base defaults to 10.  Valid bases are
        |  0 and 2-36. Base 0 means to interpret the base from the string as an
        |  integer literal.
        |  >>> int('0b100', base=0)
        |  4

        s__int__ returned non-int ({0})i
s1int() can't convert non-string with explicit bases6newint argument must be a string or a number,not '{0}'N(t__int__tAttributeErrorRt	TypeErrortformatttypeRRRt	bytearraytsuperR
t__new__R(Rtxtbasetval((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR#s.

	' 
&
#	cC stt|�j�}|d S(s&
        Without the L suffix
        i����(RR
t__repr__(tselftvalue((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR YscC s<tt|�j|�}|tkr2t|�|St|�S(N(RR
t__add__tNotImplementedR
(R!totherR"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR#ascC s<tt|�j|�}|tkr2|t|�St|�S(N(RR
t__radd__R$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR&gscC s<tt|�j|�}|tkr2t|�|St|�S(N(RR
t__sub__R$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR'mscC s<tt|�j|�}|tkr2|t|�St|�S(N(RR
t__rsub__R$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR(sscC sLtt|�j|�}t|�r.t|�S|tkrHt|�|S|S(N(RR
t__mul__RR$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR)ys
cC sLtt|�j|�}t|�r.t|�S|tkrH|t|�S|S(N(RR
t__rmul__RR$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR*�s
cC s7t|�|}t|ttf�r/t|�S|SdS(N(R
RRR
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyt__div__�s
cC s7|t|�}t|ttf�r/t|�S|SdS(N(R
RRR
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyt__rdiv__�s
cC s6|j|�}t|ttf�r.t|�S|SdS(N(t__itruediv__RRR
R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyt__idiv__�s
cC s;tt|�j|�}|tkr7t|�|}n|S(N(RR
t__truediv__R$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR/�scC stt|�j|�S(N(RR
t__rtruediv__(R!R%((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR0�scC st|�}||}|S(N(R
(R!R%tmylong((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR-�s
cC sttt|�j|��S(N(R
Rt__floordiv__(R!R%((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR2�scC sttt|�j|��S(N(R
Rt
__rfloordiv__(R!R%((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR3�scC s t|�}||}t|�S(N(R
R
(R!R%R1((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyt
__ifloordiv__�s
cC s<tt|�j|�}|tkr2t|�|St|�S(N(RR
t__mod__R$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR5�scC s<tt|�j|�}|tkr2|t|�St|�S(N(RR
t__rmod__R$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR6�scC s`tt|�j|�}|tkrBt|�}||||fSt|d�t|d�fS(Nii(RR
t
__divmod__R$R
(R!R%R"R1((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR7�s
cC s`tt|�j|�}|tkrBt|�}||||fSt|d�t|d�fS(Nii(RR
t__rdivmod__R$R
(R!R%R"R1((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR8�s
cC s<tt|�j|�}|tkr2t|�|St|�S(N(RR
t__pow__R$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR9�scC s<tt|�j|�}|tkr2|t|�St|�S(N(RR
t__rpow__R$R
(R!R%R"((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR:�scC sSt|�s7tdt|�jt|�jf��nttt|�j|��S(Ns1unsupported operand type(s) for <<: '%s' and '%s'(RRRRR
Rt
__lshift__(R!R%((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR;�s
%cC sSt|�s7tdt|�jt|�jf��nttt|�j|��S(Ns1unsupported operand type(s) for >>: '%s' and '%s'(RRRRR
Rt
__rshift__(R!R%((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR<�s
%cC sSt|�s7tdt|�jt|�jf��nttt|�j|��S(Ns0unsupported operand type(s) for &: '%s' and '%s'(RRRRR
Rt__and__(R!R%((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR=�s
%cC sSt|�s7tdt|�jt|�jf��nttt|�j|��S(Ns0unsupported operand type(s) for |: '%s' and '%s'(RRRRR
Rt__or__(R!R%((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR>�s
%cC sSt|�s7tdt|�jt|�jf��nttt|�j|��S(Ns0unsupported operand type(s) for ^: '%s' and '%s'(RRRRR
Rt__xor__(R!R%((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR?s
%cC sttt|�j��S(N(R
Rt__neg__(R!((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR@scC sttt|�j��S(N(R
Rt__pos__(R!((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyRA
scC sttt|�j��S(N(R
Rt__abs__(R!((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyRB
scC sttt|�j��S(N(R
Rt
__invert__(R!((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyRCscC s|S(N((R!((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyRscC s
|j�S(N(t__bool__(R!((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyt__nonzero__scC stt|�j�S(s<
        So subclasses can override this, Py3-style
        (RR
RE(R!((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyRDscC s
t|�S(N(R
(R!((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyt
__native__stbigc	C s�|dkrtd��n|dkr:|dkr:t�S|r�|dkr�|d}d||}|dkr�td��q�n!|dkr�td��n|}|dkr�td	��nd
|}tdt|�d|j|d�jd��}|rV|dd
@}|dkr1|r1td��n|dkrV|rVtd��qVnt|�|krwtd��n|dkr�|S|ddd�S(sG
        Return an array of bytes representing an integer.

        The integer is represented using length bytes.  An OverflowError is
        raised if the integer is not representable with the given number of
        bytes.

        The byteorder argument determines the byte order used to represent the
        integer.  If byteorder is 'big', the most significant byte is at the
        beginning of the byte array.  If byteorder is 'little', the most
        significant byte is at the end of the byte array.  To request the native
        byte order of the host system, use `sys.byteorder' as the byte order value.

        The signed keyword-only argument determines whether two's complement is
        used to represent the integer.  If signed is False and a negative integer
        is given, an OverflowError is raised.
        is$length argument must be non-negativeiisint too smal to converts&can't convert negative int to unsignedtlittleRGs*byteorder must be either 'little' or 'big's%xt0thexi�sint too big to convertsint too small to convertNi����(RHRG(t
ValueErrorRt
OverflowErrortlentzfilltdecode(	R!tlengtht	byteordertsignedtbitstnumthtsthigh_set((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pytto_bytes"s2

4cC s�|dkrtd��nt|t�r9td��n!t|tj�rZt|�}n|dkrl|n|ddd�}t|�dkr�d}ntt	|�j
d	�d
�}|r�|dd@r�|dt|�d
}n||�S(s'
        Return the integer represented by the given array of bytes.

        The mybytes argument must either support the buffer protocol or be an
        iterable object producing bytes.  Bytes and bytearray are examples of
        built-in objects that support the buffer protocol.

        The byteorder argument determines the byte order used to represent the
        integer.  If byteorder is 'big', the most significant byte is at the
        beginning of the byte array.  If byteorder is 'little', the most
        significant byte is at the end of the byte array.  To request the native
        byte order of the host system, use `sys.byteorder' as the byte order value.

        The signed keyword-only argument indicates whether two's complement is
        used to represent the integer.
        RHRGs*byteorder must be either 'little' or 'big's'cannot convert unicode objects to bytesNi����isRJii�ii(RHRG(RKRtunicodeRtcollectionstIterableRRMRRtencode(RtmybytesRQRRtbRT((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyt
from_bytesOs%	(+RRt__doc__RR R#R&R'R(R)R*R+R,R.R/R0R-R2R3R4R5R6R7R8R9R:R;R<R=R>R?R@RARBRCRRERDRFtFalseRXtclassmethodR_(((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyR
sP6								
																												-(R`t
__future__RtstructRZtfuture.types.newbytesRtfuture.types.newobjectRtfuture.utilsRRRRRRRR
RR	R
t__all__(((sD/opt/alt/python27/lib/python2.7/site-packages/future/types/newint.pyt<module>s.		�]