[Python-Dev] Questionable AST wibbles

Guido van Rossum guido at python.org
Fri Oct 21 17:26:35 CEST 2005


On 10/21/05, Jeremy Hylton <jeremy at alum.mit.edu> wrote:
> On 10/21/05, Neal Norwitz <nnorwitz at gmail.com> wrote:
> > This probably is not a big deal, but I was surprised by this change:
> >
> > +++ test_repr.py        20 Oct 2005 19:59:24 -0000      1.20
> > @@ -123,7 +123,7 @@
> >
> >     def test_lambda(self):
> >         self.failUnless(repr(lambda x: x).startswith(
> > -            "<function <lambda"))
> > +            "<function lambda"))

if this means that the __name__ attribute of a lambda now says
"lambda" instead of "<lambda>", please change it back. The angle
brackets make it stand out more, and I imagine people might be
checking for this to handle it specially.

> > This one may be only marginally worse (names w/parameter unpacking):
> >
> > test_grammar.py
> >
> > -    verify(f4.func_code.co_varnames == ('two', '.2', 'compound',
> > -                                        'argument',  'list'))
> > +    vereq(f4.func_code.co_varnames,
> > +          ('two', '.1', 'compound', 'argument',  'list'))

This doesn't bother me.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list