On Tue, Nov 14, 2017 at 3:58 AM, bvdp <b...@mellowood.ca> 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 negligible in most cases.
>
> And, yes, I am trying to share state info between modules. Is this a bad 
> thing? I guess I would write getter() and setter() functions for all this. 
> But that does seem to remind me too much of some other language :)
>

It's going to be so very marginally slower that you won't even be able
to measure it, outside of a micro-benchmark. Worry about code
correctness first, and then performance only if you actually know you
have a problem.

Sharing state between modules is fine as long as it's controlled by
one module - which is what you have here. Go ahead! Not an issue.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to