Comment on Draft Pep ver 4 -- Psuedo Deprecations of Builtins
Huaiyu Zhu
huaiyu at gauss.almadan.ibm.com
Tue Apr 30 20:52:29 EDT 2002
John Roth <johnroth at ameritech.net> wrote:
>I strongly disagree about apply(). The only use I've found for it
>varies the function which it calls, not the parameter lists! Having
>variable parameter lists doesn't hack it - I need the variable
>function.
>>> from math import *
>>> a = (2.3,)
>>> for f in [sin, cos, sqrt]: print apply(f, a)
...
0.745705212177
-0.66627602128
1.51657508881
>>> for f in [sin, cos, sqrt]: print f(*a)
...
0.745705212177
-0.66627602128
1.51657508881
Huaiyu
More information about the Python-list
mailing list