---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
global_statement.py:17:12: PLW0603 Using the global statement to update `CONSTANT` is discouraged
   |
15 | def fix_constant(value):
16 |     """All this is ok, but try not to use `global` ;)"""
17 |     global CONSTANT  # [global-statement]
   |            ^^^^^^^^ PLW0603
18 |     print(CONSTANT)
19 |     CONSTANT = value
   |

global_statement.py:24:12: PLW0603 Using the global statement to update `sys` is discouraged
   |
22 | def global_with_import():
23 |     """Should only warn for global-statement when using `Import` node"""
24 |     global sys  # [global-statement]
   |            ^^^ PLW0603
25 |     import sys
   |

global_statement.py:30:12: PLW0603 Using the global statement to update `namedtuple` is discouraged
   |
28 | def global_with_import_from():
29 |     """Should only warn for global-statement when using `ImportFrom` node"""
30 |     global namedtuple  # [global-statement]
   |            ^^^^^^^^^^ PLW0603
31 |     from collections import namedtuple
   |

global_statement.py:36:12: PLW0603 Using the global statement to update `CONSTANT` is discouraged
   |
34 | def global_del():
35 |     """Deleting the global name prevents `global-variable-not-assigned`"""
36 |     global CONSTANT  # [global-statement]
   |            ^^^^^^^^ PLW0603
37 |     print(CONSTANT)
38 |     del CONSTANT
   |

global_statement.py:43:12: PLW0603 Using the global statement to update `CONSTANT` is discouraged
   |
41 | def global_operator_assign():
42 |     """Operator assigns should only throw a global statement error"""
43 |     global CONSTANT  # [global-statement]
   |            ^^^^^^^^ PLW0603
44 |     print(CONSTANT)
45 |     CONSTANT += 1
   |

global_statement.py:50:12: PLW0603 Using the global statement to update `CONSTANT` is discouraged
   |
48 | def global_function_assign():
49 |     """Function assigns should only throw a global statement error"""
50 |     global CONSTANT  # [global-statement]
   |            ^^^^^^^^ PLW0603
51 | 
52 |     def CONSTANT():
   |

global_statement.py:60:12: PLW0603 Using the global statement to update `FUNC` is discouraged
   |
58 | def override_func():
59 |     """Overriding a function should only throw a global statement error"""
60 |     global FUNC  # [global-statement]
   |            ^^^^ PLW0603
61 | 
62 |     def FUNC():
   |

global_statement.py:70:12: PLW0603 Using the global statement to update `CLASS` is discouraged
   |
68 | def override_class():
69 |     """Overriding a class should only throw a global statement error"""
70 |     global CLASS  # [global-statement]
   |            ^^^^^ PLW0603
71 | 
72 |     class CLASS:
   |

global_statement.py:80:12: PLW0603 Using the global statement to update `CONSTANT` is discouraged
   |
78 | def multiple_assignment():
79 |     """Should warn on every assignment."""
80 |     global CONSTANT  # [global-statement]
   |            ^^^^^^^^ PLW0603
81 |     CONSTANT = 1
82 |     CONSTANT = 2
   |

global_statement.py:80:12: PLW0603 Using the global statement to update `CONSTANT` is discouraged
   |
78 | def multiple_assignment():
79 |     """Should warn on every assignment."""
80 |     global CONSTANT  # [global-statement]
   |            ^^^^^^^^ PLW0603
81 |     CONSTANT = 1
82 |     CONSTANT = 2
   |


