Thanks. I think this is understood better now. Thanks to everyone for their help. I was running low on ways to express this for clearer understanding.
Awesomeness once again from [EMAIL PROTECTED] - John On Jan 21, 2008 10:18 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > John Morris wrote: > > Ahhh. so namespaces are scoped, not objects... > > I would say names are scoped, but I guess namespaces are too. > > > You have to keep your objects separate (and make copies when needed), > > Yes > > > Python just keeps namespaces (names that refer to an object) scoped > > according to it's rules: > > http://docs.python.org/ref/naming.html > > > > So if you create an object way up in terms of scope (global), then all > > python does is handle what names are available in a given scope to refer > > to it. If you want a separate object you have to take care of that > > yourself. Efficient. > > Yes. Assignment is not copying, it is name-binding. > > > Massive potential for gotchas, especially with some > > of python's cleverness in terms of scoping rules. > > In my experience it is rare to actually need a copy of an object, and > usually pretty clear when I do. The real hurdle is getting your mental > model in sync with what Python is actually doing, rather than what you > think it should be doing. > > Kent > -- John Morris [EMAIL PROTECTED] "Do nothing which is of no use." -- Miyamoto Musashi <a href="http://profile.mygamercard.net/nerdality"> <img src="http://card.mygamercard.net/gbar/abyss/nerdality.gif" border=0> </a>
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor