29 Feb
2012
29 Feb
'12
8:29 p.m.
Craig Yoshioka wrote:
I've tried classes, decorators, and passing the conditional using 'as', as suggested by Michael, so I disagree that with is not suitable here since I have yet to find a better alternative. If you want I can give pretty concrete examples in the ways they aren't as good.
I would be interested in your concrete examples. As far as conditionally skipping the with body, where would that code go? In __enter__? How would it know whether or not to skip? ~Ethan~