Re: from xx import yy

2017-11-17 Thread Bob van der Poel
On Thu, Nov 16, 2017 at 2:46 PM, Cameron Simpson wrote: > On 16Nov2017 09:42, bvdp wrote: > >> In my original case, I think (!!!), the problem was that I had a variable >> in mod1.py and when I did the "from mod1 import myvarible" all was fine. >> Python create a new local-to-the-module variable

Re: from xx import yy

2017-11-16 Thread Cameron Simpson
On 16Nov2017 09:42, bvdp wrote: In my original case, I think (!!!), the problem was that I had a variable in mod1.py and when I did the "from mod1 import myvarible" all was fine. Python create a new local-to-the-module variable and initialized it to the value it was set to in mod1. And at this

Re: from xx import yy

2017-11-16 Thread bvdp
On Tuesday, November 14, 2017 at 2:53:22 PM UTC-7, Cameron Simpson wrote: > On 13Nov2017 08:58, bvdp wrote: > >On Sunday, November 12, 2017 at 7:18:04 PM UTC-7, bvdp wrote: > >> I'm having a conceptual mind-fart today. I just modified a bunch of code > >> to use "from xx import variable" when var

Re: from xx import yy

2017-11-14 Thread Cameron Simpson
On 13Nov2017 08:58, bvdp wrote: On Sunday, November 12, 2017 at 7:18:04 PM UTC-7, bvdp wrote: I'm having a conceptual mind-fart today. I just modified a bunch of code to use "from xx import variable" when variable is a global in xx.py. But, when I change/read 'variable' it doesn't appear to c

Re: from xx import yy (Posting On Python-List Prohibited)

2017-11-14 Thread Lawrence D’Oliveiro
On Monday, November 13, 2017 at 3:18:04 PM UTC+13, bvdp wrote: > I'm having a conceptual mind-fart today. I just modified a bunch > of code to use "from xx import variable" when variable is a global > in xx.py. But, when I change/read 'variable' it doesn't appear to change. 1) Every name in Python

Re: from xx import yy

2017-11-13 Thread Rick Johnson
On Monday, November 13, 2017 at 10:59:06 AM UTC-6, bvdp wrote: > Thanks all for confirming that I was wrong to use "from .. > import". In this case, but i wouldn't extrapolate that advice to mean that the form `from X import Y` is _always_ bad. You just need to understand the consequences of each

Re: from xx import yy

2017-11-13 Thread Chris Angelico
On Tue, Nov 14, 2017 at 3:58 AM, bvdp wrote: > Thanks all for confirming that I was wrong to use "from .. import". Hmmm, > perhaps for functions it might be okay. But, in most cases it's a lot more > obvious to use module.function() when calling. Maybe a bit slower, but I'm > sure it's negligib

Re: from xx import yy

2017-11-13 Thread bvdp
On Sunday, November 12, 2017 at 7:18:04 PM UTC-7, bvdp wrote: > I'm having a conceptual mind-fart today. I just modified a bunch of code to > use "from xx import variable" when variable is a global in xx.py. But, when I > change/read 'variable' it doesn't appear to change. I've written a bit of

Re: from xx import yy

2017-11-13 Thread Rick Johnson
On Sunday, November 12, 2017 at 8:18:04 PM UTC-6, bvdp wrote: > I'm having a conceptual mind-fart today. I just modified a bunch of code to > use "from xx import variable" when variable is a global in xx.py. But, when I > change/read 'variable' it doesn't appear to change. I've written a bit of

Re: from xx import yy

2017-11-12 Thread Chris Angelico
On Mon, Nov 13, 2017 at 1:17 PM, bvdp wrote: > I'm having a conceptual mind-fart today. I just modified a bunch of code to > use "from xx import variable" when variable is a global in xx.py. But, when I > change/read 'variable' it doesn't appear to change. I've written a bit of > code to show t

Re: from xx import yy

2017-11-12 Thread Ned Batchelder
On 11/12/17 9:17 PM, bvdp wrote: I'm having a conceptual mind-fart today. I just modified a bunch of code to use "from xx import variable" when variable is a global in xx.py. But, when I change/read 'variable' it doesn't appear to change. I've written a bit of code to show the problem: mod1.p