Am I the only one who would love these extentions? - Python 3.0 proposals (long)

Andrew Dalke adalke at mindspring.com
Tue Nov 11 18:02:38 EST 2003


Me:
> > and I think changing
> >   FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16
> > into
> >   FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT, ... = x*x for x in
> > itertools.count(1)
> > is just plain stupid.

Alex:
> Not necessarily stupid, but it sure IS semantics-altering (as well
> as syntactically incorrect in the proposed 2.4 syntax for genexps --
> you'll need parentheses around a genexp) -- a sequence of squares
> rather than one of powers of two.
> (2**x for x in itertools.count()), however, would be fine:-).

Oops!  :)

What I considered 'stupid' was changing something that was easy
to verify by eye (1, 2, 4, 8, 16) into something which used a generator
(or list comprehensions; I was experimenting with the new idea) and
is harder to verify by eye.

The generator form has the advantage of allowing new terms to be
added without additional modifications, but given how unchanging
that code is, it's a false savings.

> I think you just grabbed the record for shortest-lived proposal
> in Python's history.  Applause, applause!-).

I can do better than that ;)

I propose a requirement that all Python code include the
author's PSU name before the first exectuable statement
in the file.  It must be of the form '#PSU: ....' as in

#PSU: Parrot Funny-Walker of Wensleydale

This would let ... err, just a mo', someone's at the






More information about the Python-list mailing list