gratuitous new features in 2.0

Grant Griffin g2 at seebelow.org
Sun Aug 27 14:53:01 EDT 2000


Alex Martelli wrote:
> 
> "Grant Griffin" <g2 at seebelow.org> wrote in message
> news:39A78701.720CCEA4 at seebelow.org...
>     [snip]
> > Whatever code breakage caused by "to" can easily be repaired.  (And
> > programmers who use "to" as an identifier deserve what they get. <wink>)
> 
> These are the kinds of remarks that might end up letting me
> swallow the ugly "print >>" syntax (I understand it will be
> there whether I swallow it or not, but still it sticks in my throat),
> just because adding a keyword to an existing language is such
> a horrid situation, and yet it keeps getting belittled...!  Winks
> or no winks, this makes my skin crawl.

Wink or no wink, the point itself was actually serious. <wink>

It sounds to me like we primarily disagree on how grievous the issue of
adding new keywords is.  Personally, I don't think it's the worst thing
in the world. <"Practicality beats purity"; "readability counts">  So
please humor me for a moment, and pretend that it's not really all that
bad.  (Hold your nose, if you have to. <wink>)  Then, say the following
out loud:

	"for thing in things"

Now that's Python at its Python-est.

Next, try:

	"for index in range(quantity)"

Ditto likewise.

Next, say the following out loud:

	"print >> my_file, thing1, thing2, the_cat_in_the_hat"

What does it sound like? <honest question>  Here's the best I can come
up with:

	"print right-shift my_file, thing1, thing2, the_cat_in_the_hat."

(Well, obviously. <wink>)

Finally, (I'm sure you see where I'm going here...), say the following
out loud:

	"print to my_file, thing1, thing2, the_cat_in_the_hat"

Guido is, of course, The One Good And True Prophet of what is and isn't
"Pythonic" (at least in the capital "P" sense <wink>).  However, if one
thinks of Python as a sort of "executable pseudo-code" (as I do, but
maybe not everybody does), then the "to" form is undoubtedly more
"Pythonic"*; it practically talks: a completely untrained Pythoneer (and
maybe even a non-programmer) could figure out what devilry it's up "to"
<wink>.

Hey, speaking of "The Cat in the Hat"**, if you've read it recently, you
might recall that as The Cat gets out more and more stuff, the Goldfish
gets more and more distressed.  To wit:

   "Now look what you did!"
   Said the fish to the cat.
   "Now look at this house!
   Look at this! Look at that!"

But somehow in the end, The Cat gets it all together.

i-bet-the-goldfish-would-object-to-"to",-too-<wink>-ly y'rs,

=g-to
* Then again, "Pythonic" has many dimensions--that's why we need a
prophet, silly!
** BTW, when reading "The Cat In The Hat", the best way by far to enjoy
it is to speak it.  But don't try that with Perl <0.25 wink>
-- 
_____________________________________________________________________

Grant R. Griffin                                       g2 at dspguru.com
Publisher of dspGuru                           http://www.dspguru.com
Iowegian International Corporation	      http://www.iowegian.com



More information about the Python-list mailing list