[Python-checkins] r55033 - peps/trunk/pep-3124.txt
phillip.eby
python-checkins at python.org
Tue May 1 02:32:32 CEST 2007
Author: phillip.eby
Date: Tue May 1 02:32:18 2007
New Revision: 55033
Modified:
peps/trunk/pep-3124.txt
Log:
Fix missing imports in examples
Modified: peps/trunk/pep-3124.txt
==============================================================================
--- peps/trunk/pep-3124.txt (original)
+++ peps/trunk/pep-3124.txt Tue May 1 02:32:18 2007
@@ -179,6 +179,8 @@
effects, except for name binding side-effects (which will be described
below)::
+ from overloading import when
+
@overload
def flatten(ob: basestring):
yield ob
@@ -325,10 +327,11 @@
Like ``@when``, all of these decorators must be passed the function to
be overloaded, and can optionally accept a predicate as well::
+ from overloading import before, after
+
def begin_transaction(db):
print "Beginning the actual transaction"
-
@before(begin_transaction)
def check_single_access(db: SingletonDB):
if db.inuse:
@@ -383,6 +386,8 @@
to transform input arguments or return values, or to wrap specific
cases with special error handling or try/finally conditions, e.g.::
+ from overloading import around
+
@around(commit_transaction)
def lock_while_committing(__proceed__, db: SingletonDB):
with db.global_lock:
More information about the Python-checkins
mailing list