3
Õì2a8 ã @ 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¨ | j |ƒrd S g }d|kr:x|d D ]}|j|jƒ ƒ q$W |jjtjkrv| j|dƒ |jƒ }d|_t t
dƒ|gƒ}�n&d|krºt|d jƒ |d jƒ |d jƒ ƒ}ttj
|g| dd �}nâd
|krÖ|d jƒ }d|_n¢d|k�rj|d }|jtjk�rL|jd
jtjk�rL|jd
jd jtjk�rL|jd
jd jdk�rL| j|dƒ d S ttj
t
dƒ|jƒ gƒ}d|_t|ƒ�rxd 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_stmtZwarningr r r r r
ZpowerZtrailerZchildrenZarglistr ÚNAMEÚvaluer r )ÚselfZnodeÚresultsZtrailersÚtÚnewr © r! ú,/opt/alt/python36/lib64/python3.6/fix_map.pyÚ transform@ sF
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" Ú