"Kaz Kylheku" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Let me make the observation that  name of an inner function is, alone,
> insufficient to identify that function in a debugging scenario. If you
> have some inner function called I, defined within function F, you need
> to know that it's the I inside F, and not some other I.
>
> Look at what happens with:
>
>>>> def err():
> ...   def inner():
> ...     return nonexistent
> ...   return inner
> ...
>>>> err()
> <function inner at 0x8177304>
>>>> err()()
> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "<stdin>", line 3, in inner
> NameError: global name 'nonexistent' is not defined

So name it err_inner.  Or _err.

tjr



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

Reply via email to