From cc0bfb59f2127edbb7863b7f682f5a1f10483943 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 12 Jul 2005 16:28:56 +0000 Subject: [PATCH] Rename class ContextManager to ContextWrapper, per Nick's proposal. --- pep-0343.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pep-0343.txt b/pep-0343.txt index 175f02495..d20300882 100644 --- a/pep-0343.txt +++ b/pep-0343.txt @@ -258,7 +258,7 @@ Generator Decorator that makes it possible to use a generator that yields exactly once to control a with-statement. Here's a sketch of such a decorator: - class ContextManager(object): + class ContextWrapper(object): def __init__(self, gen): self.gen = gen @@ -287,14 +287,14 @@ Generator Decorator def contextmanager(func): def helper(*args, **kwds): - return ContextManager(func(*args, **kwds)) + return ContextWrapper(func(*args, **kwds)) return helper This decorator could be used as follows: @contextmanager def opening(filename): - f = open(filename) # IOError is untouched by ContextManager + f = open(filename) # IOError is untouched by ContextWrapper try: yield f finally: