(a,b=1,c=2,d=3,e=4)
| 1 | # simple dirty trick for automatic recursion: keyword args from locals() |
| 2 | |
| 3 | def myfunc(a,b=1,c=2,d=3,e=4): |
| 4 | _kwargs=locals().copy() # freeze unconditional at very beginning |
| 5 | print locals() |
| 6 | if e<=0: return |
| 7 | else: |
| 8 | _kwargs['e']=e-1 |
| 9 | myfunc(**_kwargs) |
| 10 | |
| 11 | # proper tools for correct/ad-hoc/fast automatic recursion |
| 12 |