ACC SHELL
Ñò
sÄMc @ s´ d Z d d k l Z d d k l Z d d k l Z d d k l Z l Z l Z l
Z
l Z l Z d „ Z
d e i f d „ ƒ YZ d „ Z d
„ Z g d
d „ Z d „ Z d
S( s: Fixer for function definitions with tuple parameters.
def func(((a, b), c), d):
...
->
def func(x, d):
((a, b), c) = x
...
It will also support lambdas:
lambda (x, y): x + y -> lambda t: t[0] + t[1]
# The parens are a syntax error in Python 3
lambda (x): x + y -> lambda x: x + y
i ( t pytree( t token( t
fixer_base( t Assignt Namet Newlinet Numbert Subscriptt symsc C s* t | t i ƒ o | i d i t i j S( Ni ( t
isinstanceR t Nodet childrent typeR t STRING( t stmt( ( s4 /usr/lib/python2.6/lib2to3/fixes/fix_tuple_params.pyt is_docstring s t FixTupleParamsc B s e Z d Z d „ Z d „ Z RS( s
funcdef< 'def' any parameters< '(' args=any ')' >
['->' any] ':' suite=any+ >
|
lambda=
lambdef< 'lambda' args=vfpdef< '(' inner=any ')' >
':' body=any
>
c s@ d | j o ˆ i | | ƒ Sg ‰ | d } | d } | d i d i t i j o' d } | d i d i } t ƒ ‰ n"