So this morning, a friend was bitching about some Python code he’d inherited and was trying to debug. The author of the code, in a fit of insanityencapsulation, had written code using a bunch of nested closures, like so: def f(): def g(): return "hello this is g" # do something with g() He wanted to poke at this code in a REPL, and in particular, was hoping to call g(), but couldn’t because it wasn’t accessible outside of the function. I made an offhand remark about poking inside the fu...