a
´i8 ã @ sb d dl mZ d dlmZ d dlmZmZmZmZm Z d dl
mZ d dl
mZ G dd„ dejƒZdS ) é )Útoken)Ú
fixer_base)ÚNameÚArgListÚCallÚListCompÚin_special_context)Úpython_symbols)ÚNodec @ s e Zd ZdZdZdZdd„ 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 C s¤ | |¡rd S g }d|v r6|d D ]}| | ¡ ¡ q"|jjtjkrr| |d¡ | ¡ }d|_t t
dƒ|gƒ}�n&d|v r¶t|d ¡ |d ¡ |d ¡ ƒ}ttj
|g| dd �}nâd
|v rÒ|d ¡ }d|_n¢d|v �rf|d }|jtjk�rH|jd
jtjk�rH|jd
jd jtjk�rH|jd
jd jdk�rH| |d¡ d S ttj
t
dƒ| ¡ gƒ}d|_t|ƒ�rtd S ttj
t
dƒt|gƒg| ƒ}d|_|j|_|S )NZextra_trailerszYou should use a for loop hereÚ ÚlistZ
map_lambdaZxpÚfpÚit)ÚprefixZmap_noneÚargÚargsé é ÚNonezjcannot convert map(None, ...) with multiple arguments because map() now truncates to the shortest sequenceÚmap)Zshould_skipÚappendZcloneÚparentÚtypeÚsymsZsimple_stmtÚwarningr r r r r
ZpowerZtrailerZchildrenZarglistr ÚNAMEÚvaluer r )ÚselfZnodeÚresultsZtrailersÚtÚnewr © r" ú-/usr/lib64/python3.9/lib2to3/fixes/fix_map.pyÚ transform@ sN
þ
ÿþý
zFixMap.transformN)Ú__name__Ú
__module__Ú__qualname__Z
BM_compatibleZPATTERNZskip_onr$ r" r" r" r# r s r N)Zpgen2r r r Z
fixer_utilr r r r r Zpygramr r Zpytreer
ZConditionalFixr r" r" r" r# Ú