A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-July/054765.html below:

[Python-Dev] Possible context managers in stdlib

[Python-Dev] Possible context managers in stdlib [Python-Dev] Possible context managers in stdlibPhillip J. Eby pje at telecommunity.com
Fri Jul 8 23:02:33 CEST 2005
At 10:24 PM 7/8/2005 +0200, Reinhold Birkenfeld wrote:
>        with sys.trace

Note that it's currently not possible to inspect the trace/profile hooks 
from Python code, only from C, so that might be, um, interesting to implement.

>* pprint: with pprint.printer (used for print)

Interesting; I'm not sure if I like it.

>* os: with os.current_directory

What does this do?  Oh, I get it.  The name's not very obvious.  I would've 
expected a more imperative name, something like 'with os.setcwd()' or 'with 
os.pushdir()'.

>       with os.modified_env
>       with os.umask/uid/gid etc.

Yeah, again I would expect more verbish names, but these are at least 
easier to grasp than current_directory was.


>* curses: with curses.wrapper
>            with logging.Logger
>* tty: with tty.raw
>        with tty.cbreak
>* cgitb: with cgitb.enabled

What do these do?

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