Add advisory to replace apply().
This commit is contained in:
parent
bf79d7da5f
commit
9ddde8f432
13
pep-0290.txt
13
pep-0290.txt
|
@ -116,6 +116,19 @@ Pattern::
|
||||||
string1.find(string2) >= 0 --> string2 in string1
|
string1.find(string2) >= 0 --> string2 in string1
|
||||||
string1.find(string2) != -1 --> 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
|
Python 2.2 or Later
|
||||||
-------------------
|
-------------------
|
||||||
|
|
Loading…
Reference in New Issue