ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/lib2to3/fixes/__pycache__/fix_map.cpython-311.opt-1.pyc

�

�f8��|�dZddlmZddlmZddlmZmZmZm	Z	m
Z
ddlmZ
ddlmZGd�dej��Zd	S)
aFixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.

As a special case, map(None, X) is changed into list(X).  (This is
necessary because the semantics are changed in this case -- the new
map(None, X) is equivalent to [(x,) for x in X].)

We avoid the transformation (except for the special case mentioned
above) if the map() call is directly contained in iter(<>), list(<>),
tuple(<>), sorted(<>), ...join(<>), or for V in <>:.

NOTE: This is still not correct if the original code was depending on
map(F, X, Y, ...) to go on until the longest argument is exhausted,
substituting None for missing values -- like zip(), it now stops as
soon as the shortest argument is exhausted.
�)�token)�
fixer_base)�Name�ArgList�Call�ListComp�in_special_context)�python_symbols)�Nodec� �eZdZdZdZdZd�ZdS)�FixMapTaL
    map_none=power<
        'map'
        trailer< '(' arglist< 'None' ',' arg=any [','] > ')' >
        [extra_trailers=trailer*]
    >
    |
    map_lambda=power<
        'map'
        trailer<
            '('
            arglist<
                lambdef< 'lambda'
                         (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any
                >
                ','
                it=any
            >
            ')'
        >
        [extra_trailers=trailer*]
    >
    |
    power<
        'map' args=trailer< '(' [any] ')' >
        [extra_trailers=trailer*]
    >
    zfuture_builtins.mapc�N�|�|��rdSg}d|vr2|dD])}|�|������*|jjt
jkrQ|�|d��|���}d|_ttd��|g��}�n�d|vr{t|d���|d���|d�����}tt
j
|g|zd�	��}�n_d
|vr"|d���}d|_n�d|vr�|d}|jt
jkr�|jd
jt
jkrd|jd
jdjt"jkr9|jd
jdjdkr|�|d��dStt
j
td��|���g��}d|_t)|��rdStt
j
td��t+|g��g|z��}d|_|j|_|S)N�extra_trailerszYou should use a for loop here��list�
map_lambda�xp�fp�it)�prefix�map_none�arg�args���Nonezjcannot convert map(None, ...) with multiple arguments because map() now truncates to the shortest sequence�map)�should_skip�append�clone�parent�type�syms�simple_stmt�warningrrrrr�power�trailer�children�arglistr�NAME�valuer	r)�self�node�results�trailers�t�newrs       �</opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_map.py�	transformzFixMap.transform@sn�����D�!�!�	��F����w�&�&��-�.�
+�
+��������	�	�*�*�*�*��;��t�/�/�/��L�L��?�@�@�@��*�*�,�,�C��C�J��t�F�|�|�c�U�+�+�C�C�
�W�
$�
$��7�4�=�.�.�0�0�"�4�=�.�.�0�0�"�4�=�.�.�0�0�2�2�C��t�z�C�5�8�#3�B�?�?�?�C�C��W�$�$��e�n�*�*�,�,����
�
��W�$�$�"�6�?�D��y�D�L�0�0��}�Q�'�,���<�<��}�Q�'�0��3�8�E�J�F�F��}�Q�'�0��3�9�V�C�C����T�,N�O�O�O����t�z�D��K�K������+F�G�G�C�!#�C�J�%�d�+�+� ��4��t�z�D��L�L�'�3�%�.�.�#A�H�#L�M�M�C��C�J��[��
��
�N)�__name__�
__module__�__qualname__�
BM_compatible�PATTERN�skip_onr3�r4r2r
r
s6�������M��G�:$�G�.�.�.�.�.r4r
N)�__doc__�pgen2rrr�
fixer_utilrrrrr	�pygramr
r#�pytreer�ConditionalFixr
r;r4r2�<module>rBs�����&������������J�J�J�J�J�J�J�J�J�J�J�J�J�J�+�+�+�+�+�+�������P�P�P�P�P�Z�
&�P�P�P�P�Pr4

Zerion Mini Shell 1.0