Email or username:

Password:

Forgot your password?
mei

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:

1 comment
rini ☁️

@mei I had made this awesome package doing this

>>> is_even(2)
True
>>> not is_even(3)
True
>>> is_even(5)
Fatal python error: number_not_even: Number was odd
[stacktrace]

To ensure truthfulness, the above error directly caused the following:

segmentation fault (core dumped) python
Go Up