global
statement detected PYL-W060325
26
27def collect_processes():
28 global processes29 results = [(proc, maybe_wait(proc)) for proc in processes]
30 processes = [proc for proc, status in results if status is True]
31 for proc, status in results:
It is recommended not to use global
statement unless it is really necessary. Global variables are dangerous because they can be simultaneously accessed from multiple sections of a program. This frequently results in bugs. This also make code difficult to read, because they force you to search through multiple functions or even modules just to understand all the different locations where the global variable is used and modified. Read more about why it should be avoided here.