On Tue, Jan 24, 2017 at 6:37 AM, João Matos <jcrma...@gmail.com> wrote: > One does not need to have 10 global vars. It may have to do with var name > length and the 79 max line length. > > This is an example from my one of my programs: > global existing_graph, expected_duration_in_sec, file_size, \ > file_mtime, no_change_counter >
I think you're already running into serious design concerns here. Why are file_size and file_mtime global? Perhaps a better design would involve a class, where this function would become a method, and those globals become "self.file_size" and "self.file_mtime". Then you can have a single global instance of that class for now, but if ever you need two of them, it's trivially easy. You encapsulate all of this global state into a coherent package. But if you MUST use globals, I would split the lines according to purpose: global existing_graph, expected_duration # "in_sec" is unnecessary global file_size, file_mtime global no_change_counter # also probably needs a new name That way, you're unlikely to run into the 80-char limit. ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/