A
Antoon Pardon
Op 2005-02-21 said:It's not only that way in python, but in java too. So it seems that there is
a fundamental principle behind it: In a language that allows sideeffects,
these will actually happen.
If you're after side-effect free programming, I recommend using a functional
programming language like ocaml or haskell. In these, you can't mutate
objects at all, only recreate them and rebind them to new variables. This
prevents whole classes of errors - but of course it also introduces all
kinds of other constraints on your programming style, e.g. using monads and
so on.
I have the impression that you misunderstood me. I'm not after a
side-effect free language. I just think python could be nicer in
allowing some side-effects.