[Python-checkins] CVS: python/dist/src/Doc/ref ref6.tex,1.50,1.51

Tim Peters tim.one@comcast.net
Mon, 01 Apr 2002 17:55:20 -0500


[Jeremy]
> I take it you mean: "The from form with * should only occur in a
> module scope."
>
> That sounds fine to me, although it leaves me wondering: "What does
> should mean?"  Does it mean that my code may break in the future?  Or
> does it mean that if Guido ever runs into my mom, he'll tell her I'm
> breaking the rules.

As I believe Robert Kahn once told Guido, there's no predicting how the
courts will rule at some future date <wink>.  A use of "should" today only
constrains today's language processors, and languages change all the time.
Some of the friendlier standards (like SUS) sometimes remember to include a
"Future Directions" footnote or section, in which they run through the
non-mandatory "should"s and try to guess which are likely to becoms
"shall"s, and which just good advice.  In the absence of such specific
indication, a standard should have a meta-rule covering unqualified
"should"s, saying whether the premsuption is that they will-- or
won't --change.  Still, most users view "should" as explicit permission to
ignore the advice with impunity.

Thought experiment:  if an alternate implementation sprung up tomorrow that
always refused to accept program text containing "import *" at other than
module scope, would Guido refuse to call it a Python implementation?  If
not, then the text should not say "should" at all:  it should say "shall".

There's no contradiction there:  a language standard imposes two sets of
requirements, one on conforming program texts, and another on conforming
implementations.  It's quite possible to say that import* shall occur at
module scope in program texts, while also saying that conforming language
processors may choose to allow violations.

If that sounds like it leads to a mess, it does:  every use of "should", and
every dodge to exempt processors from enforcing a "shall", shall be viewed
as a small failure <0.7 wink>.

BTW, note that the C std almost never uses "should", except in footnotes and
in sections clearly marked "Recommended Practice".  A language is
well-defined or it isn't, and "should" in a *definition* is usually
indicative of a lack of clarity, and/or of backbone.