[Python-ideas] Allow parentheses to be used with "with" block

Mark Lawrence breamoreboy at yahoo.co.uk
Tue Feb 17 04:05:22 CET 2015


On 17/02/2015 02:37, Steven D'Aprano wrote:
> On Mon, Feb 16, 2015 at 05:18:36PM -0500, Neil Girdhar wrote:
>> I think the most consistent way to do this if we would do it is to support
>> parentheses around the "with statement".  We now know that though it's not
>> "trivial", it's not too hard to implement it in the way that Andrew
>> suggests.  I'd consider doing it if there were an approved PEP and a
>> guaranteed fast review.
>
> Neil, I suggest you go and volunteer on the bug tracker. I posted a link
> to the open issue there. If you ask there, it won't be forgotten, and
> the core devs are more likely to take notice.
>

http://bugs.python.org/issue12782 has been closed as "won't fix". 
Presumably it can be reopened if there's enough interest.  On the other 
hand it states "Use a contextlib.ExitStack." which has already been 
referenced here.

Just my £0.02p worth.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Python-ideas mailing list