[Zope-Checkins] CVS: Zope/lib/python/TAL - TALInterpreter.py:1.77 markbench.py:1.5 timer.py:1.13
Fred L. Drake, Jr.
fred@zope.com
Thu, 27 Feb 2003 11:19:12 -0500
Update of /cvs-repository/Zope/lib/python/TAL
In directory cvs.zope.org:/tmp/cvs-serv24053/TAL
Modified Files:
TALInterpreter.py markbench.py timer.py
Log Message:
Get rid of apply(); extended call syntax is not news anymore, and apply()
will generate a PendingDeprecationWarning in Python 2.3.
=== Zope/lib/python/TAL/TALInterpreter.py 1.76 => 1.77 ===
--- Zope/lib/python/TAL/TALInterpreter.py:1.76 Thu Jan 30 13:18:44 2003
+++ Zope/lib/python/TAL/TALInterpreter.py Thu Feb 27 11:18:40 2003
@@ -90,7 +90,7 @@
def emit(self, *args):
if self.enabled:
- apply(TALGenerator.emit, (self,) + args)
+ TALGenerator.emit(self, *args)
def emitStartElement(self, name, attrlist, taldict, metaldict, i18ndict,
position=(None, None), isend=0):
=== Zope/lib/python/TAL/markbench.py 1.4 => 1.5 ===
--- Zope/lib/python/TAL/markbench.py:1.4 Wed Aug 14 17:58:54 2002
+++ Zope/lib/python/TAL/markbench.py Thu Feb 27 11:18:40 2003
@@ -33,14 +33,14 @@
def time_apply(f, args, kwargs, count):
for i in range(4):
- apply(f, args, kwargs)
+ f(*args, **kwargs)
r = [None] * count
t0 = time.clock()
for i in r:
pass
t1 = time.clock()
for i in r:
- apply(f, args, kwargs)
+ f(*args, **kwargs)
t = time.clock() - t1 - (t1 - t0)
return t / count
=== Zope/lib/python/TAL/timer.py 1.12 => 1.13 ===
--- Zope/lib/python/TAL/timer.py:1.12 Wed Aug 14 17:58:54 2002
+++ Zope/lib/python/TAL/timer.py Thu Feb 27 11:18:40 2003
@@ -47,7 +47,7 @@
sys.stderr.flush()
t0 = time.clock()
for i in range(count):
- result = apply(func, args)
+ result = func(*args)
t1 = time.clock()
sys.stderr.write("%6.3f secs for %d calls, i.e. %4.0f msecs per call\n"
% ((t1-t0), count, 1000*(t1-t0)/count))