How do I call the double() function?

Kushal Kumaran kushal.kumaran at
Sat Mar 21 16:21:19 CET 2009

On Mar 21, 7:55 pm, grocery_stocker <cdal... at> wrote:
> Given the following....
> def double(val):
>     return val.bind(lambda x: val.return_(x*2))
> I get "AttributeError: 'int' object has no attribute 'bind' " when I
> try to do the following
> double(2)
> <snipped>

See the usage of the double function in,
which is presumably where you got it from.  It's not being passed in
an ordinary int.  int's do not have bind or return_ attributes.


More information about the Python-list mailing list