---
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs
---
PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin
  --> PYI025_1.pyi:8:33
   |
 7 | def f():
 8 |     from collections.abc import Set  # PYI025
   |                                 ^^^
 9 |
10 | def f():
   |
help: Alias `Set` to `AbstractSet`
  |
7 | def f():
  -     from collections.abc import Set  # PYI025
8 +     from collections.abc import Set as AbstractSet  # PYI025
9 |
  |

PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin
  --> PYI025_1.pyi:11:51
   |
10 | def f():
11 |     from collections.abc import Container, Sized, Set, ValuesView  # PYI025
   |                                                   ^^^
12 |
13 | def f():
   |
help: Alias `Set` to `AbstractSet`
   |
10 | def f():
   -     from collections.abc import Container, Sized, Set, ValuesView  # PYI025
11 +     from collections.abc import Container, Sized, Set as AbstractSet, ValuesView  # PYI025
12 |
   |

PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin
  --> PYI025_1.pyi:16:37
   |
14 |     """Test: local symbol renaming."""
15 |     if True:
16 |         from collections.abc import Set
   |                                     ^^^
17 |     else:
18 |         Set = 1
   |
help: Alias `Set` to `AbstractSet`
   |
15 |     if True:
   -         from collections.abc import Set
16 +         from collections.abc import Set as AbstractSet
17 |     else:
   -         Set = 1
18 +         AbstractSet = 1
19 |
--------------------------------------------------------------------------------
23 |
   -     del Set
24 +     del AbstractSet
25 |
26 |     def f():
   -         print(Set)
27 +         print(AbstractSet)
28 |
   |

PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin
  --> PYI025_1.pyi:33:29
   |
31 |         print(Set)
32 |
33 | from collections.abc import Set
   |                             ^^^
34 |
35 | def f():
   |
help: Alias `Set` to `AbstractSet`
   |
19 |
   -     x: Set = set()
20 +     x: AbstractSet = set()
21 |
   -     x: Set
22 +     x: AbstractSet
23 |
--------------------------------------------------------------------------------
32 |
   - from collections.abc import Set
33 + from collections.abc import Set as AbstractSet
34 |
35 | def f():
36 |     """Test: global symbol renaming."""
   -     global Set
37 +     global AbstractSet
38 |
   -     Set = 1
   -     print(Set)
39 +     AbstractSet = 1
40 +     print(AbstractSet)
41 |
   |

PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin
  --> PYI025_1.pyi:44:33
   |
42 | def f():
43 |     """Test: nonlocal symbol renaming."""
44 |     from collections.abc import Set
   |                                 ^^^
45 |
46 |     def g():
   |
help: Alias `Set` to `AbstractSet`
   |
43 |     """Test: nonlocal symbol renaming."""
   -     from collections.abc import Set
44 +     from collections.abc import Set as AbstractSet
45 |
46 |     def g():
   -         nonlocal Set
47 +         nonlocal AbstractSet
48 |
   -         Set = 1
   -         print(Set)
49 +         AbstractSet = 1
50 +         print(AbstractSet)
   |
