Add advisory to replace apply().

This commit is contained in:
Raymond Hettinger 2003-03-07 00:21:42 +00:00
parent bf79d7da5f
commit 9ddde8f432
1 changed files with 13 additions and 0 deletions

View File

@ -116,6 +116,19 @@ Pattern::
string1.find(string2) >= 0 --> string2 in string1
string1.find(string2) != -1 --> string2 in string1
Replace apply() with a Direct Function Call
'''''''''''''''''''''''''''''''''''''''''''
In Python 2.3, apply() was marked for Pending Deprecation because it
was made obsolete by the Python 1.6's introduction of * and ** in
function calls. Using a direct function call was always a little
faster than apply() because it saved the lookup for the builtin.
Now, apply() is even slower due to its use of the warnings module.
Pattern::
apply(f,args, kwds) --> f(*args, **kwds)
Python 2.2 or Later
-------------------