Comment on Draft Pep ver 4 -- Psuedo Deprecations of Builtins
John Roth
johnroth at ameritech.net
Wed May 1 07:05:12 EDT 2002
"Huaiyu Zhu" <huaiyu at gauss.almadan.ibm.com> wrote in message
news:slrnacuf2d.9l1.huaiyu at gauss.almadan.ibm.com...
> 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
Good example. Thanks.
John Roth
More information about the Python-list
mailing list