Strange Syntax Parsing Error in Python?

Posted by user213060 on Stack Overflow See other posts from Stack Overflow or by user213060
Published on 2010-04-25T14:50:24Z Indexed on 2010/04/25 14:53 UTC
Read the original article Hit count: 289

Filed under:
|

Am I missing something here? Why shouldn't the code under the "Broken" section work? I'm using Python 2.6.

#!/usr/bin/env python

def func(a,b,c):
    print a,b,c

#Working:

p={'c':3}

func(1,
     b=2,
     c=3,
     )

#Working:

func(1,
     b=2,
     **p,)

#Broken:

func(1,
     b=2,
     **p,
     )

© Stack Overflow or respective owner

Related posts about python

Related posts about syntax-error