A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-June/054150.html below:

[Python-Dev] PEP 343 - next steps

[Python-Dev] PEP 343 - next steps [Python-Dev] PEP 343 - next stepsGuido van Rossum gvanrossum at gmail.com
Sat Jun 11 18:02:39 CEST 2005
[Nick]
> I also added a new question to the Wiki regarding what, if any,
> guarantees will be made regarding when (or if) asynchronous interrupts
> will be blocked. Given that the call to __enter__() can invoke
> arbitrary Python code, is pushing the with statement setup inside a
> single opcode actually sufficient?

Not sufficient if __enter__ is written in Python; in that case,
*nothing* can be done to make it sufficient.

The single opcode makes it possible to implement __enter__ in C to
solve the issue in specific cases.

> It also considers the possibility of using with statements in an RAII
> style by acquiring the resource in __init__ or __new__ rather than
> __enter__.

Python isn't C++; you shouldn't do that.

> This is a topic that got a brief mention during early discussion here,
> but doesn't seem to be covered in the current version of PEP 343.

I haven't been infected with the RAII meme, so I can't help you here.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4