I'm not getting some python(3.5.2) behaviour.
I got a function
In it I recall(recursion) it with
But when I don't use the
The
Ergo: What Python behaviour rule(s) I'm I missing to make sense of that last case.
---
Mmm, seems that
So ditched it in the def-part and moved it inside the function. (not needed in def + wip function. re-investigate later.)
I got a function
def get_links_titles( links_list, titles_dict={}, r=0 ):
. (Key-part: titles_dict={}
)In it I recall(recursion) it with
titles_del = get_links_titles( case_dict['redirlinks'], {}, r=r+1 )
it works as intended. The recursive case start with an empty titles_dict
case.But when I don't use the
, {}
part, and use titles_del = get_links_titles( case_dict['redirlinks'], r=r+1 )
The
titles_dict
in the recursion case is not empty, but contains the data titles_dict
had before the recursive call. (???).Ergo: What Python behaviour rule(s) I'm I missing to make sense of that last case.
---
Mmm, seems that
titles_dict={}
as function parameter is not a good idea based on some similar down the line unsuspected hiccup.So ditched it in the def-part and moved it inside the function. (not needed in def + wip function. re-investigate later.)