Nick Coghlan wrote:

> Incidentally, this discussion made me realise the real reason why using a 
> lambda to create a named 
> function is evil:
>
> Py> def f(): pass
> ...
> Py> f.func_name
> 'f'
> Py> f = lambda: None
> Py> f.func_name
> '<lambda>'
>
> I think I've heard that explanation before, but it never really clicked.

that's nothing you cannot fix, though:

    >>> f = lambda: None
    >>> f.func_name = "f"

    >>> f.func_name
    'f'

(only works in 2.4 and later, from what I can tell)

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to