Re: Variables with cross-module usage

2009-11-30 Thread Lie Ryan
On 12/1/2009 7:51 AM, Terry Reedy wrote: In everyday life and natural languages, a single name can be used to refer to multiple objects just by context without referring any namespace. Namespace are contexts. They were (re)invented in programming just to make it easier to have single name could

Re: Variables with cross-module usage

2009-11-30 Thread Terry Reedy
Lie Ryan wrote: On 11/30/2009 12:00 PM, Terry Reedy wrote: Dennis Lee Bieber wrote: In these languages, the names always refer to the same location. Python confuses matters by having names that don't really refer to location, but are attached to the objects. In everyday life and natural lang

Re: Variables with cross-module usage

2009-11-29 Thread Lie Ryan
On 11/30/2009 12:00 PM, Terry Reedy wrote: Dennis Lee Bieber wrote: In these languages, the names always refer to the same location. Python confuses matters by having names that don't really refer to location, but are attached to the objects. In everyday life and natural languages, names refe

Re: Variables with cross-module usage

2009-11-29 Thread Terry Reedy
Dennis Lee Bieber wrote: In these languages, the names always refer to the same location. Python confuses matters by having names that don't really refer to location, but are attached to the objects. In everyday life and natural languages, names refer to people, other objects, roles,

Re: Variables with cross-module usage

2009-11-29 Thread Nitin Changlani.
Thanks Dennis and Steve, This explains it all! I will discard using one.a and use one.myList[0] directly, instead. I really appreciate your patience and the elaboration of the concept. Warm Regards, Nitin Changlani. On Sun, Nov 29, 2009 at 1:02 AM, Steven D'Aprano < st...@remove-this-cybersource

Re: Variables with cross-module usage

2009-11-28 Thread Steven D'Aprano
On Sat, 28 Nov 2009 22:18:11 -0500, Nitin Changlani wrote: > Thanks for the reply MRAB, Rami, Matt and Mel, > > I was assuming that since one.myList0] = one.a, the change in one.a will > ultimately trickle down to myList[0] whenever myList[0] is printed or > used in an expression. It doesn't come

Re: Variables with cross-module usage

2009-11-28 Thread Nitin Changlani
Thanks for the reply MRAB, Rami, Matt and Mel, I was assuming that since one.myList0] = one.a, the change in one.a will ultimately trickle down to myList[0] whenever myList[0] is printed or used in an expression. It doesn't come intuitively to me as to why that should not happen. Can you kindly su

Re: Variables with cross-module usage

2009-11-28 Thread Nitin Changlani.
Thanks for the reply MRAB, Rami, Matt and Mel, I was assuming that since one.myList0] = one.a, the change in one.a will ultimately trickle down to myList[0] whenever myList[0] is printed or used in an expression. It doesn't come intuitively to me as to why that should not happen. Can you kindly su

Re: Variables with cross-module usage

2009-11-28 Thread Mel
Rami Chowdhury wrote: > Hi Nitin, > > On Sat, Nov 28, 2009 at 14:36, MRAB wrote: >> Nitin Changlani. wrote: >>> three.py >>> >>> import one >>> import two >>> >>> def argFunc(): >>> one.x = 'place_no_x' >>> one.a = 'place_no_a' >>> one.b = 'place_no_b' >>> > > I think this is what

Re: Variables with cross-module usage

2009-11-28 Thread Rami Chowdhury
Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) On Sat, Nov 28, 2009 at 14:57, Matt Nordhoff wrote: > Rami Chowdhury wrote: >> Hi Nitin, >> >> On Sat, Nov 28, 2009 at 14:36, MRAB wrote: >>> N

Re: Variables with cross-module usage

2009-11-28 Thread Matt Nordhoff
Rami Chowdhury wrote: > Hi Nitin, > > On Sat, Nov 28, 2009 at 14:36, MRAB wrote: >> Nitin Changlani. wrote: >>> three.py >>> >>> import one >>> import two >>> >>> def argFunc(): >>>one.x = 'place_no_x' >>>one.a = 'place_no_a' >>>one.b = 'place_no_b' >>> > > I think this

Re: Variables with cross-module usage

2009-11-28 Thread Rami Chowdhury
Hi Nitin, On Sat, Nov 28, 2009 at 14:36, MRAB wrote: > Nitin Changlani. wrote: >> three.py >> >> import one >> import two >> >> def argFunc(): >>    one.x = 'place_no_x' >>    one.a = 'place_no_a' >>    one.b = 'place_no_b' >> I think this is what is biting you. You might expect tha

Re: Variables with cross-module usage

2009-11-28 Thread MRAB
Nitin Changlani. wrote: Hello everyone, I am fairly new to Python and occasionally run into problems that are almost always resolved by referring to this mailing-list's archives. However, I have this one issue which has got me stuck and I hope you will be tolerant enough to help em out with i