Would Anonymous Functions Help in Learning Programming/Python?

Carsten Haese carsten at uniqsys.com
Mon Sep 24 06:19:12 EDT 2007


On Mon, 2007-09-24 at 10:05 +0000, Marc 'BlackJack' Rintsch wrote:
> On Mon, 24 Sep 2007 11:43:59 +0200, Bruno Desthuilliers wrote:
> 
> > You already can create functions without using the def statement:
> > 
> > Help on class function in module __builtin__:
> > 
> > class function(object)
> >   |  function(code, globals[, name[, argdefs[, closure]]])
> >   |
> >   |  Create a function object from a code object and a dictionary.
> >   |  The optional name string overrides the name from the code object.
> >   |  The optional argdefs tuple specifies the default argument values.
> >   |  The optional closure tuple supplies the bindings for free variables.
> >   |
> 
> Where the heck does *this* come from?  Neither Python 2.5.1 nor the
> 3.0alpha has this in `__builtin__`.

It comes from the 'new' module:

>>> import new
>>> help(new.function)
Help on class function in module __builtin__:
...

Oddly enough, the help misrepresents which module the function is coming
from.

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list