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/newrange.pyo
�
�A�[c@@s�dZddlmZddlmZmZddlmZddlm	Z	e	Z
defd��YZdefd	��YZdgZ
d
S(sw
Nearly identical to xrange.py, by Dan Crosta, from

    https://github.com/dcrosta/xrange.git

This is included here in the ``future`` package rather than pointed to as
a dependency because there is no package for ``xrange`` on PyPI. It is
also tweaked to appear like a regular Python 3 ``range`` object rather
than a Python 2 xrange.

From Dan Crosta's README:

    "A pure-Python implementation of Python 2.7's xrange built-in, with
    some features backported from the Python 3.x range built-in (which
    replaced xrange) in that version."

    Read more at
        https://late.am/post/2012/06/18/what-the-heck-is-an-xrange
i(tabsolute_import(tSequencetIterator(tislice(tcounttnewrangecB@s�eZdZd�Zed��Zed��Zed��Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�ZRS(s�
    Pure-Python backport of Python 3's range object.  See `the CPython
    documentation for details:
    <http://docs.python.org/py3k/library/functions.html#range>`_
    cG@sbt|�dkr-d|dd}}}nat|�dkr^|d|dd}}}n0t|�dkr�|\}}}ntd��y*t|�t|�t|�}}}Wntk
r�td��nX|dkr�td��n-|dkrt||�}nt||�}||_||_||_|||t	|||�|_
dS(Niiiis"range() requires 1-3 int argumentssan integer is requiredsrange() arg 3 must not be zero(tlent	TypeErrortintt
ValueErrortmintmaxt_startt_stopt_steptboolt_len(tselftargststarttstoptstep((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__init__%s(*
			cC@s|jS(N(R(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyR@scC@s|jS(N(R
(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyRDscC@s|jS(N(R(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyRHscC@s=|jdkr#d|j|jfSd|j|j|jfS(Nis
range(%d, %d)srange(%d, %d, %d)(RRR
(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__repr__LscC@s_t|t�o^|jdko,|jknp^|j|j|jf|j|j|jfkS(Ni(t
isinstanceRRRR(Rtother((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__eq__Qs"cC@s|jS(N(R(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__len__WscC@s�y||j}Wn!tk
r4td|��nXt||j�\}}|dkr�d|kos|jknr�t|�Std|��dS(s]Return the 0-based position of integer `value` in
        the sequence this range represents.s%r is not in rangeiN(RRR	tdivmodRRtabs(Rtvaluetdifftquotientt	remainder((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pytindexZs
+
cC@st||k�S(saReturn the number of ocurrences of integer `value`
        in the sequence this range represents.(R(RR((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyRfscC@s.y|j|�tSWntk
r)tSXdS(s\Return ``True`` if the integer `value` occurs in
        the sequence this range represents.N(R"tTrueR	tFalse(RR((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__contains__ls


cC@st|ddd��S(Ni����(titer(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__reversed__uscC@stt|t�r|j|�S|dkr8|j|}n|dksS||jkrbtd��n|j||jS(s�Return the element at position ``index`` in the sequence
        this range represents, or raise :class:`IndexError` if the
        position is out of range.isrange object index out of range(Rtslicet_newrange__getitem_sliceRt
IndexErrorRR(RR"((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__getitem__xs
c@sO�fd�|j�j�D�}|\}}}t�j|�j||�S(snReturn a range which represents the requested slce
        of the sequence represented by this range.
        c3@s|]}�j|VqdS(N(R(t.0tn(R(sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pys	<genexpr>�s(tindicesRRR(Rtslcetscaled_indiceststart_offsettstop_offsettnew_step((RsF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__getitem_slice�s
"

cC@s
t|�S(s_Return an iterator which enumerates the elements of the
        sequence this range represents.(trange_iterator(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__iter__�s(t__name__t
__module__t__doc__RtpropertyRRRRRRR"RR%R'R+R)R6(((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyRs										
	
R5cB@s2eZdZd�Zd�Zd�Zd�ZRS(s&An iterator for a :class:`range`.
    cC@s+tt|j|j�t|��|_dS(N(RRRRRt_stepper(Rtrange_((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyR�scC@s|S(N((R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyR6�scC@s
t|j�S(N(tnextR;(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt__next__�scC@s
t|j�S(N(R=R;(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyR=�s(R7R8R9RR6R>R=(((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyR5�s
			N(R9t
__future__RtcollectionsRRt	itertoolsRtfuture.backports.miscRt_countRR5t__all__(((sF/opt/alt/python27/lib/python2.7/site-packages/future/types/newrange.pyt<module>sw