fun fact:
>>> from amaranth import *
>>> meow = Signal()
>>> meow.name
'meow'
the signal can infer its name from the variable it’s been assigned to. it knows what variable it’s been assigned to.
this isn’t supposed to be possible. it isn’t possible.
but it works anyway.
because amaranth walks through the backtrace, finds the function in which you’re creating the Signal, disassembles its Python bytecode, and finds the right variable to read out its name
i’m not sure if i should be impressed or horrified :neocat_flush:
@mei I had made this awesome package doing this