[Python-ideas] For-loop variable scope: simultaneous possession and ingestion of cake

Bruce Leban bruce at leapyear.org
Wed Oct 8 03:57:23 CEST 2008

&aux is described here:

this says it's equivalent to let* which is described here:

In short &aux and let* evaluates each expression, assigns it to a variable
and then evaluates the next, etc. Default values in python are evaluated in
like Lisp's let, not let*.

--- Bruce

On Tue, Oct 7, 2008 at 5:39 PM, Jim Jewett <jimjjewett at gmail.com> wrote:

> On 2008/10/6 Terry Reedy <tjreedy at udel.edu> wrote:
> > you want immanetized expressions to be evaluated
> > as the same time the default arg expressions are,
> > which is when the def/lambda is executed to create
> > a function object.  The only difference between them
> > and default args is that they could not be replaced
> > by the function call, which is precise the problem with
> > default pseudoargs. Call them constants defined
> > at definition time rather than as compilation time.
> I have some vague memory that these might be called &aux variables in
> Common Lisp.
> > Do you want the constants to be names or anonymous  --
> > which is to say, would there values appear in locals()?
> > If named, their expressions could/should appear in the
> > header with a syntax similar to but somehow
> > different from default args.  A possibility:
> >    ...lambda $i=i: i
> Would giving them a __name and marking them as keyword-only meet the
> goal?  (As best I can tell, it does for methods, but not for top-level
> functions, because of the way __mangling works.)
> -jJ
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20081007/71885b50/attachment.html>

More information about the Python-ideas mailing list