Generates invalid code for functions with named vararg and unnamed kwargs

Bug #475414 reported by Michal Kwiatkowski on 2009-11-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Michal Kwiatkowski

Bug Description

foo(*args, a=1, b=2) isn't legal syntax until Python 2.6, but that's the code Pythoscope can generate in the case vararg has been assigned a name and kwarg hasn't.

Doctest for pythoscope.generator.call_as_string that reproduces the issue:

   Generates valid code when vararg has been named and kwarg wasn't.
       >>> args = serialize((1, 2, 3))
       >>> call_as_string('wrap', {'args': args, 'kwargs': serialize({'a': 6, 'b': 7})},
       ... Function('wrap', ['*args', '**kwargs']), {args: 'atuple'})
       'wrap(a=6, b=7, *atuple)'

Michal Kwiatkowski (ruby) wrote :

Fixed in trunk r322.

Changed in pythoscope:
assignee: nobody → Michal Kwiatkowski (ruby)
status: Confirmed → Fix Committed
Changed in pythoscope:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers