. Python 2.1 function attributes

Barry A. Warsaw barry at digicool.com
Sun Jan 28 01:06:58 EST 2001


>>>>> "JD" == Jan Dries <jdries at mail.com> writes:

    JD> On the other hand, adding features just because someone has a
    JD> patch for it is just as bad an idea as adding features by
    JD> vote.

Absolutely, and trust me, as someone who's probably had more patches
and suggestions rejected than accepted, it's all part of the process.
You get an idea, create a patch, play with it to see how and if it
works, and throw it over the transom.  Some make it, most don't.  Big
deal.  When I design my own language, it'll be perfect, and it'll have
a 100% completely satisfied user base <1 of 1 wink>.

    JD> Perhaps if "print >> file, something" were written as "print
    JD> to file, something" there wouldn't be so much controversy over
    JD> it, even though it wouldn't be doing more or less than it does
    JD> today.

We tried it.  Using an identifier in that spot caused irreconcilable
syntactic ambiguities, so we had to pick a non-identifier.  After
extensive market research <wink> `>>' was picked because it had the
highest correlation to `to' in the test group of damn crazy followers
of the horn and demented bass players posing as hackers until the
record deal comes through.  Besides, `>>' stands out much better than
`to' does in practice, which you want (really).

Seriously, I've written a boatload of code that used the stdout
switcheroo idiom and it's just plain unweildy for anything more than
Usenet post examples.  Extended print is clean, nicely polymorphic,
and fully gulped in a glance.  Rewriting Mailman's CGI driver script
to use extended print sealed it for me.  It simplified the code,
shorted it, and made it more robust.

and-if-that's-not-an-excuse-to-reject-it-i-don't-know-what-is-ly y'rs,
-Barry




More information about the Python-list mailing list