RE: Underscore data hiding (was python development practices?)
by Tim Peters other posts by this author
Nov 2 2001 7:05PM messages near this date
Re: Underscore data hiding (was python development practices?)
|
Re: Underscore data hiding (was python development practices?)
[Cliff Wells]
> People keep insisting that the Python development team won't introduce
> changes that break backward compatability.
Who cares what people keep insisting? Certainly not the Python development
team <wink> .
Here's the plain truth: Guido considers backward compatibility to be very
important, but not an absolute criterion. There is nothing in Python's
design that rates "absolute" status. Every decision is a tradeoff among
competing desires, and people who want backward compatibility to win every
time are doomed to occasional outrage; ditto people who give infinite weight
to "runtime speed", or "obviousness (to me)", or "saving keystrokes", or
"more like language L", or "runs on 19-bit minicomputers from 1967", etc
etc.
That said, Python's name-hiding conventions meet their modest design goals,
and not a one of them has ever been changed. New gimmicks have been added
every few years, most recently that __all__ at module level can be used to
limit the names sucked up by "import *".
> ...
> However, I would definitely be wary of making my code depend upon
> something like the name-mangling scheme,
I don't expect it will change (although new gimmicks may be added).
> which is clearly a hack
Guido didn't think so (and every complaint ever made about it was made at at
least once before it was implemented, so the odds of a compelling new
argument are approximately nil).
> and actually seems a likely place to see a future change.
That's only because you think it's a hack <wink> . Python *used* to have an
"access" keyword, implementing an elaborate name-visibility scheme of the
kind some people favor. Guido dislike it so much he never documented it,
and eventually ripped out all the code in support of it (making "access" the
only keyword ever removed).
expected-__tim-to-be-a-mangled-tim-until-he-dies-ly y'rs - tim
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Peter Wang
Peter Hansen
Toby Dickenson
Tim Peters
Steve Holden
Steve Holden
Cliff Wells
Tim Peters
Martijn Faassen
Cliff Wells
Cliff Wells
Martijn Faassen
Martijn Faassen
Paul Rubin
Russell E. Owen
Barry A. Warsaw
Martijn Faassen
Peter Wang
Skip Montanaro
John Roth
David Bolen
Peter Wang
Peter Wang
Skip Montanaro
Chris Tavares
Darren Collins
David Bolen
Paul Rubin
Paul Rubin
Peter Wang
F Basegmez
Richard Jones
Richard Jones
Neal Norwitz
Graham Ashton
Peter Wang
Russell E. Owen
Skip Montanaro
Cliff Wells
Hung Jung Lu
Wade Leftwich
Peter Wang
Peter Wang
Peter Wang
Chris Gonnerman
Paul Rubin
Andrew Dalke
Paul Rubin
Luigi Ballabio
Paul Rubin
Tim Peters
John Roth
Paul Rubin
Richard Jones
|