> def getjlistrenderer(opname):
> def listrender():
> # use opname, eg ops=getlist(opname)
> # or set local fn variable
> return renderer;
> return listrender;
> #?or f=listrender(); return f;
>
> Is it really as simple as this?
Assuming your indentation is actually OK then yes, it is
as easy as
Yes, it really is that simple. :-)
A common example is a function that makes a function which adds a constant to
its argument:
>>> def makeadder(n):
... def adder(x):
... return x + n
... return adder
...
Make a function that adds 3 to its argument...note there is no special syntax for the
I'm looking for resources to help me with a fn that returns a fn after
binding one of its arguments (aka currying, like the bind1st of C++)
Considering Python syntax is quite straightforward, this is my first try:
def getjlistrenderer(opname):
def listrender():
# use opnam