[Python-ideas] Where-statement (Proposal for function expressions)

Paul Moore p.f.moore at gmail.com
Fri Jul 17 15:36:10 CEST 2009


2009/7/17 Gerald Britton <gerald.britton at gmail.com>:
> Using "where" would have the advantage of avoiding a function call,
> though I suppose it wouldn't save (much) stack space since it needs a
> new scope anyway.  I see the "where" clause as a useful way to
> abstract a section of code to keep the high level in view, then break
> it down as you go.

You're assuming that the implementation of where is faster than a
function call. Given that the defined semantics are in terms of
defining then calling a temporary function, this may well be an
invalid assumption. (And if it isn't, then can the tricks which get
used to speed up the where cause please be used to speed up function
calls in general, too - as that would be far more generally useful!
:-))

Paul.



More information about the Python-ideas mailing list