On Sat, Dec 14, 2013 at 12:29:54PM +1000, Amit Saha wrote:

> Consider this simple example:
> 
> >>> l = lambda x: x**2
> >>> apply(l, (3,))
> 9

The built-in function apply is deprecated in Python 2 and removed in 
Python 3. Instead apply, you should use argument unpacking:

l(*(3,))

In this case, it's silly to unpack a tuple of a single value, instead 
you should just do this:

l(3)


-- 
Steven
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to