pep 308: why doing (almost) nothing suffices

Edward K. Ream edream at tds.net
Mon Mar 10 08:20:25 EST 2003


> Hm.  What about this little problem?
>
>     >>> def optional_reverse(s, reverse=0):
>     ...     return choose_eval(reverse, 's.reverse()', 's')
>     ...
>     >>> optional_reverse('foo', 1)
>     [...]
>     NameError: name 's' is not defined

Ooooops.  This destroys my idea.

> I suppose choose_eval could be special-cased to take implicit
> arguments of the locals and globals of the calling context.

Yeah, but now we're talking seriously ugly.

> > P.P.S. All criticisms of this brilliant proposal are obviously
impertinent,
> > even if valid.
>
> I am ashamed.  Forgive me!

It is I why should be blushing.  Thanks, Steven, for the correction.

Edward
--------------------------------------------------------------------
Edward K. Ream   email:  edream at tds.net
Leo: Literate Editor with Outlines
Leo: http://personalpages.tds.net/~edream/front.html
--------------------------------------------------------------------






More information about the Python-list mailing list