§
    ZQd8  ã                   ó|   — d Z ddlmZ ddlmZ ddlmZmZmZm	Z	m
Z
 ddlmZ ddlmZ  G d„ dej        ¦  «        Zd	S )
a  Fixer 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                   ó    — e Zd ZdZdZdZd„ ZdS )Ú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*]
    >
    zfuture_builtins.mapc                 óN  — |                       |¦  «        rd S g }d|v r2|d         D ])}|                     |                     ¦   «         ¦  «         Œ*|j        j        t
          j        k    rQ|                      |d¦  «         |                     ¦   «         }d|_        t          t          d¦  «        |g¦  «        }�nÞd|v r{t          |d                              ¦   «         |d                              ¦   «         |d                              ¦   «         ¦  «        }t          t
          j        |g|z   d¬	¦  «        }�n_d
|v r"|d                              ¦   «         }d|_        nød|v rã|d         }|j        t
          j        k    r„|j        d         j        t
          j        k    rd|j        d         j        d         j        t"          j        k    r9|j        d         j        d         j        dk    r|                      |d¦  «         d S t          t
          j        t          d¦  «        |                     ¦   «         g¦  «        }d|_        t)          |¦  «        rd S t          t
          j        t          d¦  «        t+          |g¦  «        g|z   ¦  «        }d|_        |j        |_        |S )NÚextra_trailerszYou 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Úwarningr   r   r   r   r   ÚpowerÚtrailerÚchildrenÚarglistr   ÚNAMEÚvaluer	   r   )ÚselfÚnodeÚresultsÚtrailersÚtÚnewr   s          ú,/usr/lib/python3.11/lib2to3/fixes/fix_map.pyÚ	transformzFixMap.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   © r4   r2   r   r      s6   € € € € € Ø€Mð€Gð: $€Gð.ð .ð .ð .ð .r4   r   N)Ú__doc__Úpgen2r   r   r   Ú
fixer_utilr   r   r   r   r	   Úpygramr
   r#   Úpytreer   ÚConditionalFixr   r;   r4   r2   ú<module>rB      sÄ   ððð ð& Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JØ +Ð +Ð +Ð +Ð +Ð +Ø Ð Ð Ð Ð Ð ðPð Pð Pð Pð PˆZÔ&ñ Pô Pð Pð Pð Pr4   