Does Python really follow its philosophy of "Readability counts"?

Russ P. Russ.Paielli at gmail.com
Sat Jan 24 20:43:16 EST 2009


On Jan 24, 5:09 pm, Luis Zarrabeitia <ky... at uh.cu> wrote:

> I didn't say "at all". Those were your words, not mine.
> I said that it makes no sense that the power lies on _you_ instead of on _my
> team_. And, when I said that, I recall we were talking about the python
> language, not C.

Once again, if you have the source code for the library (and the right
to modify it), how does the "power" lie with the library implementer
rather than you the user?

You say you don't want to "fork" the library. Let's stipulate for the
sake of argument that a one-line change is indeed a "fork." Think
about what you are saying. You are saying that you should dictate how
the producer of the library should implement it because you don't want
to be bothered to "fork" it. If you don't like his design decisions,
shouldn't the onus be on *you* to make the trivial change necessary to
get access to what you want?

Imagine a person who repairs computers. He is really annoyed that he
constantly has to remove the cover to get at the guts of the computer.
So he insists that computers cases should be made without covers.
After all, manufacturers put covers on computers only because they
don't trust us and think we're too "stupid" to safely handle an
uncovered computer box.

That is logically equivalent to your position on enforced access
restrictions in software.

> And, FYI, when programming in java, C++ or C#, I do use "private" and
> "protected" variables, not becasue I want to forbid others from using it, but
> because it is [rightly?] assumed that everything marked as public is safe to use
> - and I consider that a strong enough "external" reason to do it.

You could just use leading underscores and note their meaning in the
documentation. If that's such a great approach, why not do it? Yes, I
know, it's not a widely used convention in those other languages. Fair
enough. But you could still do it if it's such a good idea.



More information about the Python-list mailing list