Yes, they will always be needed, except perhaps for an empty parameter
list; you may be able to write lambda: blah instead of lambda(): blah.

--Guido

On 5/1/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
>
> >I'm running into something that may make me require parentheses around
> >lambda's argument list.
> >
>
> Are the parens always needed or will it depend on the surrounding
> tokens?  Adding extra parens feels a bit odd in the following situations:
>
>     databases = filter(lambda name: name.startswith('2006'),
> cursor.fetchall())
>     mylist.sort(key = lambda record:  record.name.lower())
>
>
> Raymond
>
>


--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to