enjoy-digital / litex

Build your hardware, easily!
Other
3.03k stars 573 forks source link

build: io: don't use mutable object as default value #2086

Closed maass-hamburg closed 1 month ago

maass-hamburg commented 2 months ago

don't use mutable object (here: ClockSignal()) as default value, because they will be the same object. Leeds to problems, when for example two SDRInput are used in two different Modules and one of them is used with a ClockDomainsRenamer(), then both are changed.

more infos: https://florimond.dev/en/posts/2018/08/python-mutable-defaults-are-the-source-of-all-evil

enjoy-digital commented 1 month ago

Thanks @maass-hamburg!