loose methods : Smalltalk asPython

Jean-Paul Calderone exarkun at divmod.com
Wed Dec 27 09:28:17 EST 2006


On Wed, 27 Dec 2006 19:03:12 +1100, Steven D'Aprano <steve at remove.this.cybersource.com.au> wrote:
>
>You can't modify the built-in classes. I'm not sure that it is a good idea
>to allow built-ins to be modified. When I see an int, I like the fact that
>I know what the int can do, and I don't have to worry about whether it has
>been modified by some piece of code elsewhere.

I wonder how this is different from any other class.  If you see a StringIO
or a socket, don't you also expect to know what it can do?  But in fact you
_do_ have to worry about whether it has been modified, at least according
to your argument.  Do you often worry about it, though?  And if not, has it
ever come back to bite you?  If so, perhaps more than just built-in classes
should be restricted in this way?  If not, why should built-ins have the
restriction?

Jean-Paul



More information about the Python-list mailing list