function - When to use globals (or at least file wide) variables in Python -


As a Javascript developer *, I avoid global Also of type, but I can not help but am surprised that many times they are "ok". For example, I have a file of utility classes used on my app and they often use "Pretty Print" for debugging. So I should include it:

  pp = pprint.PrettyPrinter (indent = 4)  

It would be OK to declare it in almost every oracle Just above the file above the import so that all the fanks use it ??

To be a frank, I'm still learning that " Pythonic " means and is well respected that we, a community As, it is better to follow very similar styles. So, I appreciate all the approaches.


* I'm a JavaScript developer who embraces greatness with insanity and enthusiasm, which is a dragon!


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -