Diez B. Roggisch
deets at nospam.web.de
Fri Jan 25 20:16:52 CET 2008
MartinRinehart at gmail.com schrieb:
> Diez B. Roggisch wrote:
>> No, there is no way. You would change general interpreter behavior if
>> you could set arbitrary operators for predefined types.
>> Start grumping...
> Thank you, Diez.
> If I ever design a language, please remind me that complete, easy,
> well-documented access to the working of the internals (and the
> ability to change same) would be very, uh, what's the right word?
As you say - it's a question of design & thus taste. Python has chosen
to _not_ allow to change (all) inner workings of itself in favor of not
introducing subtle bugs that arise from somebody (accidentially or not)
altering behavior of builtins that might effect code he'd never intended
But you _can_ create subclasses of these builtins and adapt their
behavior. I for once like it that way. If you don't - to bad for you. It
won't change, so either you live with it, or start working on your
lex/yacc skillz and create your own language. Or switch to Ruby, which
allow for what you desire (AFAIK, not entirely sure though)
More information about the Python-list