---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLE0115 Name `counter` is both `nonlocal` and `global`
 --> nonlocal_and_global.py:7:12
  |
6 | def count():
7 |     global counter
  |            ^^^^^^^
8 |     nonlocal counter
9 |     counter += 1
  |

PLE0115 Name `counter` is both `nonlocal` and `global`
  --> nonlocal_and_global.py:20:20
   |
18 |             counter += 1
19 |         else:
20 |             global counter
   |                    ^^^^^^^
21 |             counter += 1
   |

PLE0115 Name `counter` is both `nonlocal` and `global`
  --> nonlocal_and_global.py:31:16
   |
29 |             nonlocal counter
30 |             counter += 1
31 |         global counter
   |                ^^^^^^^
   |

PLE0115 Name `counter` is both `nonlocal` and `global`
  --> nonlocal_and_global.py:36:12
   |
34 | def count():
35 |     nonlocal counter
36 |     global counter
   |            ^^^^^^^
37 |     counter += 1
   |
