News for hackers. Stuff that matters.
Re:Neuron, a new VS Code extension for data science by mirashii on Thursday November 01, 2018 @12:17PM (#18355502)
You can actually do this as a context manager, I have done something very similar in the past. I created a dummy context manager with a unique name and used an importhook to do an AST rewrite to the body of the context manager. It's a bit of a hack (okay, a lot of a hack), but allows for some really neat patterns that context managers didn't allow.

There are no comments on this comment yet.