[pythran] multiple default arguments

  • From: Jochen S <cycomanic@xxxxxxxxx>
  • To: pythran@xxxxxxxxxxxxx
  • Date: Fri, 6 Nov 2020 09:03:34 +0100

Hi

if I understand #1243 correctly I cannot export a function with  multiple
default arguments, but only use the second or third. Something along the
lines of:

#pythran export test(float64, int (int, int))
#pythran export test(float64, (int, int))
#pythran export test(float64, int)
#pythran export test(float64)
def test(x, i=0, t=(1,2)):
    print(x)
    print(i)
    print(t)


At least that doesn't seem to work for me. and just specifying the first
and last line I would always have to either pass i and t or none of them
correct?

Is there are way of working around this, except for writing a python
wrapper?

Cheers
Jochen

Other related posts: