strict python?

Erik Max Francis max at alcyone.com
Fri Dec 7 09:01:48 CET 2001


Fernando Pérez wrote:

> I honestly don't see any reason for something like that not to be
> included in python (other than perhaps 'if perl has it it can't be
> good' :)

Agreed.  For the record, I wasn't suggesting something mandatory.  As
with all good warning facilities, there should be ways to circumvent
them through choice of deliberate syntax.  For instance, gcc has very
good warning facilities even for fairly mundane stuff, but much of it is
overridable with syntax.  For instance,

	if (a = b) ...

generates a warning ("Are you sure you meant assignment instead of
equality?"), but using an extra layer of parentheses makes the warning
go away ("I know what I'm doing, don't warn me about this"):

	if ((a = b)) ...

Obviously that precise syntax doesn't translate into Python, it was just
an example of the type of thing I'm referring to.

PyChecker is a very worthwhile project that's updated regularly; is
there perhaps some interest in incorporating it into the Standard
library where it can be maintained internally, so that new features that
are added can have appropriate warnings added as well?

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Laws are silent in time of war.
\__/ Cicero
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.



More information about the Python-list mailing list