sgzwiz / brython

Automatically exported from code.google.com/p/brython
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

keyword parameter get inverted with ordinal overload #58

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
def ordkey(o1,o2, k1=1, k2='k2'):
 print ('o1 %d ,o2 %s, k1= %d, k2= %s'%(o1,o2, k1, k2))
# this works fine
ordkey(1,'2', k1=3, k2='k4')
# this shoul fail, but works, since overload order is inverted
ordkey(1,'2', 'k4', 3)
# this fails with TypeError: %d format : a number is required, not <class 'str'>
ordkey(1,'2', 3, 'k4')

What is the expected output? What do you see instead?
Expected:
o1 1 ,o2 2, k1= 3, k2= k4
TypeError: %d format: a number is required, not str
o1 1 ,o2 2, k1= 3, k2= k4

instead second lin prints as first and last line fails with run time error

What version of the product are you using? On what operating system?
Brython version 1.0.20130126-094636 
Linux Mint 14 "Nadia"

Please provide any additional information below.
Works as expected in ipython, Python 2.7.3 (default, Sep 26 2012, 21:53:58)

Original issue reported on code.google.com by ca...@nce.ufrj.br on 28 Jan 2013 at 9:35