Re: ethical questions about global variables

2008-12-16 Thread Дамјан Георгиевски
> By "per-class-instance variables", you are talking > about instance attributes? I.e. "self.use_gmt_times"? > I don't see much difference between global variables > and instance attributes. using global variable in modules makes the module not Thread-safe Using a instance attribute allows more

Re: ethical questions about global variables

2008-12-16 Thread Giampaolo Rodola'
On 16 Dic, 18:01, ianaré wrote: > For anything more complicated than a simple script, I find it easier > to use some sort of config object. This could be a simple dictionnary > type class, where the values can be set/retrieved by the other classes > directly, or a more elaborate class including fu

Re: ethical questions about global variables

2008-12-16 Thread ianaré
For anything more complicated than a simple script, I find it easier to use some sort of config object. This could be a simple dictionnary type class, where the values can be set/retrieved by the other classes directly, or a more elaborate class including functions to set/ retrieve the variables. T

Re: ethical questions about global variables

2008-12-16 Thread Yinon Ehrlich
On Dec 16, 4:45 am, "Giampaolo Rodola'" wrote: > Hi, > in a module of mine (ftpserver.py) I'd want to add a (boolean) global > variable named "use_gmt_times" to decide whether the server has to > return times in GMT or localtime but I'm not sure if it is a good idea > because of the "ethical" doub

Re: ethical questions about global variables

2008-12-16 Thread Giampaolo Rodola'
On 16 Dic, 07:23, Michele Simionato wrote: > On Dec 16, 3:45 am, "Giampaolo Rodola'" wrote: > > > Hi, > > in a module of mine (ftpserver.py) I'd want to add a (boolean) global > > variable named "use_gmt_times" to decide whether the server has to > > return times in GMT or localtime but I'm not s

Re: ethical questions about global variables

2008-12-16 Thread Gabriel Genellina
En Tue, 16 Dec 2008 00:45:05 -0200, Giampaolo Rodola' escribió: Another doubt is the naming convention. PEP-8 states that global variables should use the lower_case_naming_convention but I've seen a lot of library module using the UPPER_CASE_NAMING_CONVENTION. What am I supposed to do about it?

Re: ethical questions about global variables

2008-12-16 Thread Bruno Desthuilliers
Giampaolo Rodola' a écrit : Hi, in a module of mine (ftpserver.py) I'd want to add a (boolean) global variable named "use_gmt_times" to decide whether the server has to return times in GMT or localtime but I'm not sure if it is a good idea because of the "ethical" doubts I'm gonna write below. I

Re: ethical questions about global variables

2008-12-15 Thread Michele Simionato
On Dec 16, 3:45 am, "Giampaolo Rodola'" wrote: > Hi, > in a module of mine (ftpserver.py) I'd want to add a (boolean) global > variable named "use_gmt_times" to decide whether the server has to > return times in GMT or localtime but I'm not sure if it is a good idea > because of the "ethical" doub

Re: ethical questions about global variables

2008-12-15 Thread rurpy
On Dec 15, 11:00 pm, ru...@yahoo.com wrote: > #my_module > class Config: pass > config = Config() > > def func1(state): > config.A = 1 > def func2(state) > config.A = 2 > def func3(state) > print config.A That of course should have been: def func1(config): config.A = 1 def func2(c

Re: ethical questions about global variables

2008-12-15 Thread rurpy
On Dec 15, 7:45 pm, "Giampaolo Rodola'" wrote: > in a module of mine (ftpserver.py) I'd want to add a (boolean) global > variable named "use_gmt_times" to decide whether the server has to > return times in GMT or localtime but I'm not sure if it is a good idea > because of the "ethical" doubts I'm

Re: ethical questions about global variables

2008-12-15 Thread James Mills
On Tue, Dec 16, 2008 at 12:45 PM, Giampaolo Rodola' wrote: > Hi, > in a module of mine (ftpserver.py) I'd want to add a (boolean) global > variable named "use_gmt_times" to decide whether the server has to > return times in GMT or localtime but I'm not sure if it is a good idea > because of the "e

ethical questions about global variables

2008-12-15 Thread Giampaolo Rodola'
Hi, in a module of mine (ftpserver.py) I'd want to add a (boolean) global variable named "use_gmt_times" to decide whether the server has to return times in GMT or localtime but I'm not sure if it is a good idea because of the "ethical" doubts I'm gonna write below. In first place I've never liked