Re: [Python-ideas] Generator-based context managers can't skip __exit__

2016-11-05 Thread Nick Coghlan
On 6 November 2016 at 14:46, Ram Rachum wrote: > I worked around this problem by adding `except GeneratorExit: raise` in my > context manager, but that's an ugly solution. Adding `except GeneratorExit: raise` to a try statement with a finally clause won't prevent the finally

Re: [Python-ideas] Small improvements to the profile/cProfile API

2016-11-05 Thread Giampaolo Rodola'
Long ago I posted a patch for this (decorator + context manager) but I bumped into a weird error I wasn't able to fix (see last comment): http://bugs.python.org/issue9285 On Wed, Nov 2, 2016 at 10:45 PM, Tim Mitchell wrote: > Hi Ben, > > Mostly I just print to

[Python-ideas] PEP 532: A circuit breaking operator and protocol

2016-11-05 Thread Nick Coghlan
Hi folks, As promised, here's a follow-up to the withdrawn PEP 531 that focuses on coming up with a common protocol driven solution to conditional evaluation of subexpressions that also addresses the element-wise comparison chaining problem that Guido noted when rejecting PEP 335. I quite like