include statement

Gabriel Genellina gagsl-py at yahoo.com.ar
Wed Sep 20 15:39:42 EDT 2006


At Wednesday 20/9/2006 03:50, joakim.hove at gmail.com wrote:

>My application has a configuration file where lots of variables are
>set. (The configuration file is python source, so there is no
>home-brewed parsing involved.) The configuration file is starting to
>get quite large and unwieldy, so for this reason I would like to split
>it in several files.
>
>I know I could do:
>from configA import *
>from configB import *
>
>But I felt that the import statemant was 'more' than I wanted. Maybe I
>am just pedantic.

You can limit the range of "from...import *" declaring a __all__ 
variable in the imported module; this way you import exactly what is 
needed (and the rest is kept as "private")



Gabriel Genellina
Softlab SRL 


	
	
		
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas




More information about the Python-list mailing list