Does Python really follow its philosophy of "Readability counts"?
bruno.42.desthuilliers at websiteburo.invalid
Wed Jan 14 17:56:38 CET 2009
Paul Rubin a écrit :
> "James Mills" <prologic at shortcircuit.net.au> writes:
>> You do realize this is a model and not strictly a requirement. Quite
>> a few things in Python are done merely by convention.
>> Don't get caught up.
> But, if something is done by convention, then departing from the
> convention is by definition unconventional. If you do something
> unconventional in a program, it could be on purpose for a reason, or
> it could be by accident indicating a bug.
> I don't understand why some folks spew such violent rhetoric against
> the idea of augmenting Python with features to alert you automatically
> when you depart from the convention, so that you can check that the
> departure is actually what you wanted. A lot of the time, I find, the
> departures are accidental and automated checks would save me
> considerable debugging.
Given that the convention for "protected" attributes in Python is to
prefix them with an underscore, I fail to see how one could
"accidentally" mess with implementation details. Typing a leading
underscore is rarely a typo.
Oh, BTW, IIRC, there are a couple lint-like apps for Python, some of
them being able to warn you about most of these (potential) problems.
More information about the Python-list