Mar-27-2017, 10:11 AM
(Mar-27-2017, 08:40 AM)zivoni Wrote: why you need to pass locals anyway?
i am making "python format" config files. that means lots of simple coding will be used that just does put things in the local namespace.
account = "080643210675" vin = "1HGBH41JXMN109186" phone = "+18009004321"it doesn't have to be locals. it just has to be somewhere. if nothing else is added to to the space then there is the option to extract "misspelled" config options. but the global space gets stuff added so it is to be avoid if that option is to be used. my pyconf() function was intended to return a dictionary of what the config file set. so, the issue of how comprehensions are used is going to be used will be the same in a python format config file as in regular code. no big deal. however people deal with it in regular code, just do the same in a python format config file. use of comprehensions in config files is expected to be much less frequent in config files than in regular code. and they are rare in regular code. it was just a happen chance that i used one. i did not know of the namespace isolation thing. now i do.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.