Viewing File: /opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/fix_paren.cpython-35.pyc
¯ÕYfË ã @ sI d Z d d l m Z d d l m Z m Z Gd d „ d e j ƒ Z d S)zuFixer that addes parentheses where they are required
This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``.é )Ú
fixer_base)ÚLParenÚRParenc @ s( e Z d Z d Z d Z d d „ Z d S)ÚFixParenTa
atom< ('[' | '(')
(listmaker< any
comp_for<
'for' NAME 'in'
target=testlist_safe< any (',' any)+ [',']
>
[any]
>
>
|
testlist_gexp< any
comp_for<
'for' NAME 'in'
target=testlist_safe< any (',' any)+ [',']
>
[any]
>
>)
(']' | ')') >
c C sL | d } t ƒ } | j | _ d | _ | j d | ƒ | j t ƒ ƒ d S)NÚtargetÚ é )r ÚprefixZinsert_childZappend_childr )ÚselfZnodeZresultsr Zlparen© r ú</opt/alt/python35/lib64/python3.5/lib2to3/fixes/fix_paren.pyÚ transform% s
zFixParen.transformN)Ú__name__Ú
__module__Ú__qualname__Z
BM_compatibleZPATTERNr
r r r r r s r N)Ú__doc__r r Z
fixer_utilr r ZBaseFixr r r r r Ú<module> s
Back to Directory
File Manager