[Libre-soc-bugs] [Bug 485] Create I-Cache from microwatt icache.vhdl

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Oct 8 19:33:13 BST 2020


--- Comment #61 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Cole Poirier from comment #60)

> Got it. Out of curiosity and to be a better python programmer, why is this
> bad practice?

aside from needing totally different dictionaries, it's called a "singleton". 
i.e. that dictionary is *shared between function calls*.

i.e. you call the function once, make some changes, then call it again and
despite expecting an entirely new fresh default dict argument, after many days
of frustrating debugging go "wtf, this dictionary has been modified, wtf??"

don't do it unless that is EXACTLY what you want and make absolutely sure that
you comment the code saying "this is intentionally a singleton default
dictionary" because it is a major source of really obscure bugs.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list