<div dir="auto">For what it's worth, I normally just do:<div dir="auto"><br></div><div dir="auto">global a</div><div dir="auto">global b</div><div dir="auto"><br></div><div dir="auto">But I've never needed more than two.</div><div dir="auto">I think if you need more, then there is a serious style issue. That it looks syntactically ugly is a feature.</div><div dir="auto"><br></div><div dir="auto">Perhaps we should deprecate the comma in global ;-) .</div><div dir="auto"><br></div><div dir="auto">Stephan</div></div><div class="gmail_extra"><br><div class="gmail_quote">Op 23 jan. 2017 8:38 p.m. schreef "João Matos" <<a href="mailto:jcrmatos@gmail.com">jcrmatos@gmail.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
You are correct, my mistake. I should have written global and not globals.<br>
<br>
The purpose of using parentheses on the import statement is not (in my view) for operational efficiency but for appearance/cleaness.<br>
The same applies to using it to global.<br>
<br>
One does not need to have 10 global vars. It may have to do with var name length and the 79 max line length.<br>
<br>
This is an example from my one of my programs:<br>
global existing_graph, expected_duration_in_sec, file_size, \<br>
file_mtime, no_change_counter<br>
<br>
Anyway, the use of global being rare is of no concern. The point of my suggestion is standardization.<br>
My opinion is that a standard language is easier to learn (and teach) than one that has different syntax for the same issue, depending on the statement.<br>
<br>
In short, if the recommended multi-line use for import is<br>
<br>
import (a, b,<br>
c)<br>
<br>
instead of<br>
<br>
import a, b, \<br>
c<br>
<br>
Then the same should apply to global.<br>
<br>
<br>
Best regards,<br>
<br>
JM<br>
<br>
<br>
<br>
<br>
On 23-01-2017 19:25, Terry Reedy wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 1/23/2017 1:43 PM, João Matos wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I would like to suggest that globals should follow the existing rule<br>
(followed by the import statement, the if statement and in other places)<br>
for extending beyond 1 line using parentheses.<br>
Like this:<br>
globals (var_1, var_2,<br>
var_3)<br>
<br>
instead of what must be done now, which is:<br>
globals var_1, var_2 \<br>
var_3<br>
</blockquote>
<br>
The declaration keyword is 'global'; 'globals' is the built-in function. In any case<br>
<br>
global var_1, var_2<br>
global var_3<br>
<br>
works fine. There is no connection between the names and, unlike with import, no operational efficiency is gained by mashing the statements together.<br>
<br>
This issue should be rare. The global statement is only needed when one is rebinding global names within a function*. If a function rebinds 10 different global names, the design should probably be re-examined.<br>
<br>
* 'global' at class scope seems useless.<br>
<br>
a = 0<br>
class C:<br>
a = 1<br>
<br>
has the same effect as<br>
a = 0<br>
a = 1<br>
class C: pass<br>
<br>
</blockquote>
<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a></blockquote></div></div>