global
statement detected PYL-W0603 13
14 :return: Windows / Linux / Darwin / github / v2p / ql_new / ql /空
15 """
16 global ENV 17 if ENV:
18 return ENV
19
20 :return: 签到配置文件对象
21 """
22 print_ver()
23 global DATA24 if DATA:
25 return DATA
26
18
19
20def log(info):
21 global desp 22 desp = desp + info + "\n\n"
23
24
20
21
22def log(info: str):
23 global desp 24 desp = desp + info + "\n"
25
26
169
170
171def log(info: str):
172 global desp173 desp = desp + info + "\n"
174
175
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.