[Python-Dev] Re: Python-checkins digest, Vol 1 #370 - 8 msgs

David Ascher da@ski.org
Mon, 28 Feb 2000 09:42:52 -0800


> Am I responsible for everybody else's bad coding style?
>
> If it's not in the docs, where does everybody get the idea that this
> is legal?  (The few cases in the std library are unlikely to be the
> only source; they were in pretty obscure places.)

I think you're responsible for a little bit of the confusion.  Most
people read the docs at the beginning to learn the basics, and then
experiment with the interpreter.  The fact that it worked is naturally
interpreted by users as meaning that it should work.  Very few of
Python's semantics are accidental, so people "believe" the interpreter.

Teaching people when ()'s are necessary in Python and when they're not
is not a trivial task if you're talking to someone who'se never heard
the difference between a parse tree and a pear tree.  In my courses I
typically say "()'s are sometimes optional" and leave it at that -- I
expect the students' experience to guide them.  That experience will be
interaction-driven, not doc-driven.

max/min() is another example, btw.  What's the "right" way?  To call
them with N arguments where N > 1, or with a sequence argument?  If I
look it up in the doc, I can tell (it's the latter, folks) -- but it
seems arbitrary.  After all, the max/min calls/macros typically used in
other languages require 2 arguments, so extending that to N arguments is
conceptually at least as easy as shrinking it to a sequence argument.

--david