<_florent_>
for now I have to comment my import to use ISE or VIVADO
<_florent_>
but I'd like to be able to pass a parameter to the Platform class to choose the toolchain
<LoneTech>
yay! python questions I might be able to figure out :)
<ysionneau>
\o/
<_florent_>
but since it does not seems to be possible to do dynamic inheritance, I'm a stuck...
<_florent_>
does someone has idea or a workaround for that?
<LoneTech>
dynamic inheritance is quite possible; just create the class dynamically. i.e. you could make a metaclass
<_florent_>
in fact here I want to be able to do this:
<_florent_>
Platform(toolchain="ise") in make.py --> return Platform that inherit from XilinxISEPlatform
<_florent_>
Platform(toolchain="vivado") in make.py --> return Platform that inherit from XilinxVIVADOPlatform
<_florent_>
LoneTech : thanks, I'm looking at that
<LoneTech>
so a structure like: def Platform(toolchain): class Platform(toolchain): ... return Platform could do that
<LoneTech>
i.e. a fresh class produced when that function is called
<LoneTech>
memoize it if you want to reuse it for type checks or something
<LoneTech>
though I'm not sure this is very elegant from either OO or performance perspectives, it doesn't feel like the most performance critical part
<_florent_>
ah yes indeed if Plaform is a function it's easier :)