%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/past/builtins/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/past/builtins/noniterators.pyo

�
�A�[c@`s&dZddlmZmZmZddlmZmZddlZddlm	Z	ddl
mZd�Zer�ddl
Z
d�Zd	�Zd
�Zd�ZeZeZeZddlmZeZd
ddddgZn?ddlZejZejZejZejZejZgZdS(s,
This module is designed to be used as follows::

    from past.builtins.noniterators import filter, map, range, reduce, zip

And then, for example::

    assert isinstance(range(5), list)

The list-producing functions this brings in are::

- ``filter``
- ``map``
- ``range``
- ``reduce``
- ``zip``

i(tdivisiontabsolute_importtprint_function(tchaintstarmapN(t
basestring(tPY3cC`stjt||��S(N(Rt
from_iterabletmap(tftitems((sK/opt/alt/python27/lib/python2.7/site-packages/past/builtins/noniterators.pytflatmapscG`st|d�}t|dt�r<|�jtj|��St|dttf�rh|tj|��Sttj|��SdS(s*
        filter(function or None, sequence) -> list, tuple, or string

        Return those items of sequence for which function(item) is true.
        If function is None, return the items that are true.  If sequence
        is a tuple or string, return the same type, else return a list.
        iN(ttypet
isinstanceRtjointbuiltinstfilterttupletlist(targstmytype((sK/opt/alt/python27/lib/python2.7/site-packages/past/builtins/noniterators.pyt	oldfilter$scG`s�tj|�}t|�}t|�dkr1gS|dkrF|}ntt||��}yBtg|D]}t|�^qh�dkr�ttj|��SWnt	k
r�}nX|S(s
        map(function, sequence[, sequence, ...]) -> list

        Return a list of the results of applying the function to the
        items of the argument sequence(s).  If more than one sequence is
        given, the function is called with an argument list consisting of
        the corresponding item of each sequence, substituting None for
        missing values when not all sequences have the same length.  If
        the function is None, return a list of the items of the sequence
        (or a list of tuples if more than one sequence).

        Test cases:
        >>> oldmap(None, 'hello world')
        ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']

        >>> oldmap(None, range(4))
        [0, 1, 2, 3]

        More test cases are in past.tests.test_builtins.
        iiN(
t	itertoolstzip_longestRtlentNoneRtmaxRRt	TypeError(tfunct	iterablestzippedtltresulttitemte((sK/opt/alt/python27/lib/python2.7/site-packages/past/builtins/noniterators.pytoldmap8s	+cO`sttj||��S(N(RRtrange(Rtkwargs((sK/opt/alt/python27/lib/python2.7/site-packages/past/builtins/noniterators.pytoldrange�scO`sttj||��S(N(RRtzip(RR%((sK/opt/alt/python27/lib/python2.7/site-packages/past/builtins/noniterators.pytoldzip�s(treduceRRR$R)R'(t__doc__t
__future__RRRRRRt
past.typesRt
past.utilsRRRRR#R&R(RRR$t	functoolsR)R't__all__t__builtin__(((sK/opt/alt/python27/lib/python2.7/site-packages/past/builtins/noniterators.pyt<module>s2			�							

Zerion Mini Shell 1.0