pep 336: Make None Callable
Terry Hancock
hancock at anansispaceworks.com
Thu Nov 4 19:48:01 EST 2004
On Thursday 04 November 2004 02:41 pm, Alex Martelli wrote:
> Terry Hancock <hancock at anansispaceworks.com> wrote:
> ...
> > I just noticed though, that:
> >
> > noop = lambda *a, **kw: None
> >
> > is illegal (apparently lambda doesn't support argument indirection (or
> > whatever that "*" syntax is properly called)). Never tried it before.
>
> ??? it's quite OK:
>
> kallisti:~/cb/cha/oop/cba alex$ python2.3
> Python 2.3 (#1, Sep 13 2003, 00:49:11)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> lambda *a, **k: None
> <function <lambda> at 0x61430>
Oh DUH! I actually typed:
noop = lambda *a, *kw: None
which *is* a syntax error of course. Sorry about that. That's
a relief.
Terry
--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks http://www.anansispaceworks.com
More information about the Python-list
mailing list