Ë
    #´˜j8  ã                   ó~   — 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y	)
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y)Ú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                 ó
  — | j                  |«      ry g }d|v r)|d   D ]!  }|j                  |j                  «       «       Œ# |j                  j                  t
        j                  k(  rA| j                  |d«       |j                  «       }d|_        t        t        d«      |g«      }�nÈd|v rbt        |d   j                  «       |d   j                  «       |d   j                  «       «      }t        t
        j                  |g|z   d¬	«      }�nbd
|v r|d   j                  «       }d|_        �n	d|v rù|d   }|j                  t
        j                  k(  r�|j                  d   j                  t
        j                   k(  rs|j                  d   j                  d   j                  t"        j$                  k(  r<|j                  d   j                  d   j&                  dk(  r| j                  |d«       y t        t
        j                  t        d«      |j                  «       g«      }d|_        t)        |«      ry 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          ú'lib/python3.12/lib2to3/fixes/fix_map.pyÚ	transformzFixMap.transform@   s  € Ø×Ñ˜DÔ!ØàˆØ˜wÑ&ØÐ-Ô.�Ø—‘ §¡£	Õ*ð /ð �;‰;×Ñœt×/Ñ/Ò/Ø�L‰L˜Ð?Ô@Ø—*‘*“,ˆCØˆCŒJÜ”t˜F“| c UÓ+ŠCØ˜WÑ$Ü˜7 4™=×.Ñ.Ó0Ø" 4™=×.Ñ.Ó0Ø" 4™=×.Ñ.Ó0ó2ˆCô ”t—z‘z C 5¨8Ñ#3¸BÔ?ŠCð ˜WÑ$Ø˜e‘n×*Ñ*Ó,�Ø�–
à˜WÑ$Ø" 6™?�DØ—y‘y¤D§L¡LÒ0Ø—}‘} QÑ'×,Ñ,´·±Ò<Ø—}‘} QÑ'×0Ñ0°Ñ3×8Ñ8¼E¿J¹JÒFØ—}‘} QÑ'×0Ñ0°Ñ3×9Ñ9¸VÒCØŸ™ Tð ,Nô Oð äœtŸz™z¬D°«K¸¿¹»Ð+FÓG�CØ!#�C”Jä% dÔ+Øä”t—z‘z¤D¨£L´'¸3¸%³.Ð#AÀHÑ#LÓMˆCØˆCŒJà—[‘[ˆŒ
Øˆ
ó    N)Ú__name__Ú
__module__Ú__qualname__ÚBM_compatibleÚPATTERNÚskip_onr3   © r4   r2   r   r      s   „ Ø€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      s2   ðñõ& Ý ß JÕ JÝ +Ý ôPˆZ×&Ñ&õ Pr4   