I am not python expert, but got hurt by passing dictionary as
optional argument.

Session:

In [1]: def f(n,a,ca={}):
   ...:     for i in range(n):
   ...:         ca[i+a]=i+a
   ...:         print(i,"len(cac)",len(ca))
   ...:

In [2]: f(2,2)
0 len(cac) 1
1 len(cac) 2

In [3]: f(2,4)
0 len(cac) 3
1 len(cac) 4

What is the scientific way to avoid `0 len(cac) 3`?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAGUWgD_DgiifZDyxJWLNPEm0vsWNfpn_xj0UJjn9B9QiQOBZLw%40mail.gmail.com.

Reply via email to