stupid closure tricks in py3k
This is kind of silly, but I like the nonlocal keyword in Python 3 (well, ok, I like let-bindings in Lisps much much better, but this will do) and how you can get a closure and then poke the insides of the closure to see what it’s up to. I’m sure this isn’t recommended, but it’s a fun trick:
|
|
I’d guess the locations of cells in the closure tuple are determined at compile time (i.e. they won’t change between runs), but I haven’t investigated this.