Where do nested functions live?

Fredrik Lundh fredrik at pythonware.com
Sat Oct 28 05:16:17 EDT 2006


Ben Finney wrote:

> If you want something that can be called *and* define its attributes,
> you want something more complex than the default function type. Define
> a class that has a '__call__' attribute, make an instance of that, and
> you'll be able to access attributes and call it like a function.

I turned Steven's question and portions of the answers into a Python FAQ 
entry:

     http://effbot.org/pyfaq/where-do-nested-functions-live.htm

Hope none of the contributors mind.

</F>




More information about the Python-list mailing list