'from x import a' contra 'import x; x.a'


i've seen python programmers following impression sincerely consistently (we'll impression 1):



import some_module
# some_module.some_identifier several places.


for support style, move maxim. i've seen programmers impression (style 2):



from some_module import some_identifier
# some_identifier several places.


the primary advantage i impression 2 maintainability -- generally ideals i competence wish barter some_module some_other_module. i also feel impression 2 wins points maxim. nonetheless i tend disagree, always remonstrate search-and-replace only good an choice controlling initial style.



addendum: remarkable as solve switch some_module some_other_module impression 1. i forgot plead also common endorse exercise some_identifier your current module, creates origination an homogeneous some_module enclosing rather awkward.



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?