scared about refrences...
steve at holdenweb.com
Tue Oct 31 20:34:33 CET 2006
> I don't understand why python would insist that everything must be a
We can tell that :)
> It is of course helpful sometime but other times its not... and now
> I'm sorta out
> of luck...
There are very good reasons for Python's namespace model. Sure it's
different from some other languages, but it's actually been some
people's preferred semantics for a very long time now (the
recently-deceased Ralph Griswold, may he rest in peace, chose a very
similar model for Icon.
> I don't know how to make this structure immutable... Pickle it? Seems
> inefficient to me...
> Every time I pass a variable now I will worry that it will be changed
> by the function...
> I haven't worried about things like this since the very early days of
> I don't know.. maybe I have more to learn.
You do. Firstly, learn to leave your paranoia outside your programming
life. If a function or method makes undocumented changes to its mutable
parameters then it needs changing (or its documentation does).
Adequate testing should reveal such nonsenses before release.
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden
More information about the Python-list