---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP035 [*] Import from `collections.abc` instead: `Mapping`
 --> UP035.py:2:1
  |
1 | # UP035
2 | from collections import Mapping
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 |
4 | from collections import Mapping as MAP
  |
help: Import from `collections.abc`
  |
1 | # UP035
  - from collections import Mapping
2 + from collections.abc import Mapping
3 |
  |

UP035 [*] Import from `collections.abc` instead: `Mapping`
 --> UP035.py:4:1
  |
2 | from collections import Mapping
3 |
4 | from collections import Mapping as MAP
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5 |
6 | from collections import Mapping, Sequence
  |
help: Import from `collections.abc`
  |
3 |
  - from collections import Mapping as MAP
4 + from collections.abc import Mapping as MAP
5 |
  |

UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence`
 --> UP035.py:6:1
  |
4 | from collections import Mapping as MAP
5 |
6 | from collections import Mapping, Sequence
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 |
8 | from collections import Counter, Mapping
  |
help: Import from `collections.abc`
  |
5 |
  - from collections import Mapping, Sequence
6 + from collections.abc import Mapping, Sequence
7 |
  |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:8:1
   |
 6 | from collections import Mapping, Sequence
 7 |
 8 | from collections import Counter, Mapping
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 9 |
10 | from collections import (Counter, Mapping)
   |
help: Import from `collections.abc`
   |
7  |
   - from collections import Counter, Mapping
8  + from collections import Counter
9  + from collections.abc import Mapping
10 |
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:10:1
   |
 8 | from collections import Counter, Mapping
 9 |
10 | from collections import (Counter, Mapping)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 |
12 | from collections import (Counter,
   |
help: Import from `collections.abc`
   |
9  |
   - from collections import (Counter, Mapping)
10 + from collections import (Counter)
11 + from collections.abc import Mapping
12 |
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:12:1
   |
10 |   from collections import (Counter, Mapping)
11 |
12 | / from collections import (Counter,
13 | |                          Mapping)
   | |_________________________________^
14 |
15 |   from collections import Counter, \
   |
help: Import from `collections.abc`
   |
11 |
   - from collections import (Counter,
   -                          Mapping)
12 + from collections import (Counter)
13 + from collections.abc import Mapping
14 |
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:15:1
   |
13 |                            Mapping)
14 |
15 | / from collections import Counter, \
16 | |                          Mapping
   | |________________________________^
17 |
18 |   from collections import Counter, Mapping, Sequence
   |
help: Import from `collections.abc`
   |
14 |
   - from collections import Counter, \
   -                          Mapping
15 + from collections import Counter
16 + from collections.abc import Mapping
17 |
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence`
  --> UP035.py:18:1
   |
16 |                          Mapping
17 |
18 | from collections import Counter, Mapping, Sequence
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 |
20 | from collections import Mapping as mapping, Counter
   |
help: Import from `collections.abc`
   |
17 |
   - from collections import Counter, Mapping, Sequence
18 + from collections import Counter
19 + from collections.abc import Mapping, Sequence
20 |
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:20:1
   |
18 | from collections import Counter, Mapping, Sequence
19 |
20 | from collections import Mapping as mapping, Counter
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 |
22 | if True:
   |
help: Import from `collections.abc`
   |
19 |
   - from collections import Mapping as mapping, Counter
20 + from collections import Counter
21 + from collections.abc import Mapping as mapping
22 |
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:23:5
   |
22 | if True:
23 |     from collections import Mapping, Counter
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 |
25 | if True:
   |
help: Import from `collections.abc`
   |
22 | if True:
   -     from collections import Mapping, Counter
23 +     from collections import Counter
24 +     from collections.abc import Mapping
25 |
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:28:5
   |
26 |     if True:
27 |         pass
28 |     from collections import Mapping, Counter
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 |
30 | if True: from collections import Mapping
   |
help: Import from `collections.abc`
   |
27 |         pass
   -     from collections import Mapping, Counter
28 +     from collections import Counter
29 +     from collections.abc import Mapping
30 |
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:30:10
   |
28 |     from collections import Mapping, Counter
29 |
30 | if True: from collections import Mapping
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 |
32 | import os
   |
help: Import from `collections.abc`
   |
29 |
   - if True: from collections import Mapping
30 + if True: from collections.abc import Mapping
31 |
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:33:1
   |
32 | import os
33 | from collections import Counter, Mapping
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34 | import sys
   |
help: Import from `collections.abc`
   |
32 | import os
   - from collections import Counter, Mapping
33 + from collections import Counter
34 + from collections.abc import Mapping
35 | import sys
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`, `Callable`
  --> UP035.py:37:5
   |
36 |   if True:
37 | /     from collections import (
38 | |         Mapping,
39 | |         Callable,
40 | |         Bad,
41 | |         Good,
42 | |     )
   | |_____^
43 |
44 |   from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
   |
help: Import from `collections.abc`
   |
37 |     from collections import (
   -         Mapping,
   -         Callable,
38 |         Bad,
39 |         Good,
40 |     )
41 +     from collections.abc import Mapping, Callable
42 |
   |

UP035 [*] Import from `collections.abc` instead: `Callable`
  --> UP035.py:44:1
   |
42 |     )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 |
46 | if True: from collections import (
   |
help: Import from `collections.abc`
   |
43 |
   - from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
44 + from typing import Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
45 + from collections.abc import Callable
46 |
   |

UP035 [*] Import from `collections` instead: `OrderedDict`
  --> UP035.py:44:1
   |
42 |     )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 |
46 | if True: from collections import (
   |
help: Import from `collections`
   |
43 |
   - from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
44 + from typing import Callable, Match, Pattern, List, AbstractSet, ContextManager
45 + from collections import OrderedDict
46 |
   |

UP035 [*] Import from `re` instead: `Match`, `Pattern`
  --> UP035.py:44:1
   |
42 |     )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 |
46 | if True: from collections import (
   |
help: Import from `re`
   |
43 |
   - from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
44 + from typing import Callable, List, OrderedDict, AbstractSet, ContextManager
45 + from re import Match, Pattern
46 |
   |

UP035 `typing.List` is deprecated, use `list` instead
  --> UP035.py:44:1
   |
42 |     )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 |
46 | if True: from collections import (
   |

UP035 `typing.AbstractSet` is deprecated, use `collections.abc.Set` instead
  --> UP035.py:44:1
   |
42 |     )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 |
46 | if True: from collections import (
   |

UP035 `typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead
  --> UP035.py:44:1
   |
42 |     )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 |
46 | if True: from collections import (
   |

UP035 Import from `collections.abc` instead: `Mapping`
  --> UP035.py:46:10
   |
44 |   from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
45 |
46 |   if True: from collections import (
   |  __________^
47 | |     Mapping, Counter)
   | |_____________________^
48 |
49 |   # Bad imports from PYI027 that are now handled by PYI022 (UP035)
   |
help: Import from `collections.abc`

UP035 `typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead
  --> UP035.py:50:1
   |
49 | # Bad imports from PYI027 that are now handled by PYI022 (UP035)
50 | from typing import ContextManager
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51 | from typing import OrderedDict
52 | from typing_extensions import OrderedDict
   |

UP035 [*] Import from `collections` instead: `OrderedDict`
  --> UP035.py:51:1
   |
49 | # Bad imports from PYI027 that are now handled by PYI022 (UP035)
50 | from typing import ContextManager
51 | from typing import OrderedDict
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52 | from typing_extensions import OrderedDict
53 | from typing import Callable
   |
help: Import from `collections`
   |
50 | from typing import ContextManager
   - from typing import OrderedDict
51 + from collections import OrderedDict
52 | from typing_extensions import OrderedDict
   |

UP035 [*] Import from `typing` instead: `OrderedDict`
  --> UP035.py:52:1
   |
50 | from typing import ContextManager
51 | from typing import OrderedDict
52 | from typing_extensions import OrderedDict
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53 | from typing import Callable
54 | from typing import ByteString
   |
help: Import from `typing`
   |
51 | from typing import OrderedDict
   - from typing_extensions import OrderedDict
52 + from typing import OrderedDict
53 | from typing import Callable
   |

UP035 [*] Import from `collections.abc` instead: `Callable`
  --> UP035.py:53:1
   |
51 | from typing import OrderedDict
52 | from typing_extensions import OrderedDict
53 | from typing import Callable
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
54 | from typing import ByteString
55 | from typing import Container
   |
help: Import from `collections.abc`
   |
52 | from typing_extensions import OrderedDict
   - from typing import Callable
53 + from collections.abc import Callable
54 | from typing import ByteString
   |

UP035 [*] Import from `collections.abc` instead: `ByteString`
  --> UP035.py:54:1
   |
52 | from typing_extensions import OrderedDict
53 | from typing import Callable
54 | from typing import ByteString
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55 | from typing import Container
56 | from typing import Hashable
   |
help: Import from `collections.abc`
   |
53 | from typing import Callable
   - from typing import ByteString
54 + from collections.abc import ByteString
55 | from typing import Container
   |

UP035 [*] Import from `collections.abc` instead: `Container`
  --> UP035.py:55:1
   |
53 | from typing import Callable
54 | from typing import ByteString
55 | from typing import Container
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56 | from typing import Hashable
57 | from typing import ItemsView
   |
help: Import from `collections.abc`
   |
54 | from typing import ByteString
   - from typing import Container
55 + from collections.abc import Container
56 | from typing import Hashable
   |

UP035 [*] Import from `collections.abc` instead: `Hashable`
  --> UP035.py:56:1
   |
54 | from typing import ByteString
55 | from typing import Container
56 | from typing import Hashable
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
57 | from typing import ItemsView
58 | from typing import Iterable
   |
help: Import from `collections.abc`
   |
55 | from typing import Container
   - from typing import Hashable
56 + from collections.abc import Hashable
57 | from typing import ItemsView
   |

UP035 [*] Import from `collections.abc` instead: `ItemsView`
  --> UP035.py:57:1
   |
55 | from typing import Container
56 | from typing import Hashable
57 | from typing import ItemsView
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58 | from typing import Iterable
59 | from typing import Iterator
   |
help: Import from `collections.abc`
   |
56 | from typing import Hashable
   - from typing import ItemsView
57 + from collections.abc import ItemsView
58 | from typing import Iterable
   |

UP035 [*] Import from `collections.abc` instead: `Iterable`
  --> UP035.py:58:1
   |
56 | from typing import Hashable
57 | from typing import ItemsView
58 | from typing import Iterable
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
59 | from typing import Iterator
60 | from typing import KeysView
   |
help: Import from `collections.abc`
   |
57 | from typing import ItemsView
   - from typing import Iterable
58 + from collections.abc import Iterable
59 | from typing import Iterator
   |

UP035 [*] Import from `collections.abc` instead: `Iterator`
  --> UP035.py:59:1
   |
57 | from typing import ItemsView
58 | from typing import Iterable
59 | from typing import Iterator
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
60 | from typing import KeysView
61 | from typing import Mapping
   |
help: Import from `collections.abc`
   |
58 | from typing import Iterable
   - from typing import Iterator
59 + from collections.abc import Iterator
60 | from typing import KeysView
   |

UP035 [*] Import from `collections.abc` instead: `KeysView`
  --> UP035.py:60:1
   |
58 | from typing import Iterable
59 | from typing import Iterator
60 | from typing import KeysView
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 | from typing import Mapping
62 | from typing import MappingView
   |
help: Import from `collections.abc`
   |
59 | from typing import Iterator
   - from typing import KeysView
60 + from collections.abc import KeysView
61 | from typing import Mapping
   |

UP035 [*] Import from `collections.abc` instead: `Mapping`
  --> UP035.py:61:1
   |
59 | from typing import Iterator
60 | from typing import KeysView
61 | from typing import Mapping
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
62 | from typing import MappingView
63 | from typing import MutableMapping
   |
help: Import from `collections.abc`
   |
60 | from typing import KeysView
   - from typing import Mapping
61 + from collections.abc import Mapping
62 | from typing import MappingView
   |

UP035 [*] Import from `collections.abc` instead: `MappingView`
  --> UP035.py:62:1
   |
60 | from typing import KeysView
61 | from typing import Mapping
62 | from typing import MappingView
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63 | from typing import MutableMapping
64 | from typing import MutableSequence
   |
help: Import from `collections.abc`
   |
61 | from typing import Mapping
   - from typing import MappingView
62 + from collections.abc import MappingView
63 | from typing import MutableMapping
   |

UP035 [*] Import from `collections.abc` instead: `MutableMapping`
  --> UP035.py:63:1
   |
61 | from typing import Mapping
62 | from typing import MappingView
63 | from typing import MutableMapping
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64 | from typing import MutableSequence
65 | from typing import MutableSet
   |
help: Import from `collections.abc`
   |
62 | from typing import MappingView
   - from typing import MutableMapping
63 + from collections.abc import MutableMapping
64 | from typing import MutableSequence
   |

UP035 [*] Import from `collections.abc` instead: `MutableSequence`
  --> UP035.py:64:1
   |
62 | from typing import MappingView
63 | from typing import MutableMapping
64 | from typing import MutableSequence
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65 | from typing import MutableSet
66 | from typing import Sequence
   |
help: Import from `collections.abc`
   |
63 | from typing import MutableMapping
   - from typing import MutableSequence
64 + from collections.abc import MutableSequence
65 | from typing import MutableSet
   |

UP035 [*] Import from `collections.abc` instead: `MutableSet`
  --> UP035.py:65:1
   |
63 | from typing import MutableMapping
64 | from typing import MutableSequence
65 | from typing import MutableSet
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 | from typing import Sequence
67 | from typing import Sized
   |
help: Import from `collections.abc`
   |
64 | from typing import MutableSequence
   - from typing import MutableSet
65 + from collections.abc import MutableSet
66 | from typing import Sequence
   |

UP035 [*] Import from `collections.abc` instead: `Sequence`
  --> UP035.py:66:1
   |
64 | from typing import MutableSequence
65 | from typing import MutableSet
66 | from typing import Sequence
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
67 | from typing import Sized
68 | from typing import ValuesView
   |
help: Import from `collections.abc`
   |
65 | from typing import MutableSet
   - from typing import Sequence
66 + from collections.abc import Sequence
67 | from typing import Sized
   |

UP035 [*] Import from `collections.abc` instead: `Sized`
  --> UP035.py:67:1
   |
65 | from typing import MutableSet
66 | from typing import Sequence
67 | from typing import Sized
   | ^^^^^^^^^^^^^^^^^^^^^^^^
68 | from typing import ValuesView
69 | from typing import Awaitable
   |
help: Import from `collections.abc`
   |
66 | from typing import Sequence
   - from typing import Sized
67 + from collections.abc import Sized
68 | from typing import ValuesView
   |

UP035 [*] Import from `collections.abc` instead: `ValuesView`
  --> UP035.py:68:1
   |
66 | from typing import Sequence
67 | from typing import Sized
68 | from typing import ValuesView
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69 | from typing import Awaitable
70 | from typing import AsyncIterator
   |
help: Import from `collections.abc`
   |
67 | from typing import Sized
   - from typing import ValuesView
68 + from collections.abc import ValuesView
69 | from typing import Awaitable
   |

UP035 [*] Import from `collections.abc` instead: `Awaitable`
  --> UP035.py:69:1
   |
67 | from typing import Sized
68 | from typing import ValuesView
69 | from typing import Awaitable
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70 | from typing import AsyncIterator
71 | from typing import AsyncIterable
   |
help: Import from `collections.abc`
   |
68 | from typing import ValuesView
   - from typing import Awaitable
69 + from collections.abc import Awaitable
70 | from typing import AsyncIterator
   |

UP035 [*] Import from `collections.abc` instead: `AsyncIterator`
  --> UP035.py:70:1
   |
68 | from typing import ValuesView
69 | from typing import Awaitable
70 | from typing import AsyncIterator
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71 | from typing import AsyncIterable
72 | from typing import Coroutine
   |
help: Import from `collections.abc`
   |
69 | from typing import Awaitable
   - from typing import AsyncIterator
70 + from collections.abc import AsyncIterator
71 | from typing import AsyncIterable
   |

UP035 [*] Import from `collections.abc` instead: `AsyncIterable`
  --> UP035.py:71:1
   |
69 | from typing import Awaitable
70 | from typing import AsyncIterator
71 | from typing import AsyncIterable
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72 | from typing import Coroutine
73 | from typing import Collection
   |
help: Import from `collections.abc`
   |
70 | from typing import AsyncIterator
   - from typing import AsyncIterable
71 + from collections.abc import AsyncIterable
72 | from typing import Coroutine
   |

UP035 [*] Import from `collections.abc` instead: `Coroutine`
  --> UP035.py:72:1
   |
70 | from typing import AsyncIterator
71 | from typing import AsyncIterable
72 | from typing import Coroutine
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73 | from typing import Collection
74 | from typing import AsyncGenerator
   |
help: Import from `collections.abc`
   |
71 | from typing import AsyncIterable
   - from typing import Coroutine
72 + from collections.abc import Coroutine
73 | from typing import Collection
   |

UP035 [*] Import from `collections.abc` instead: `Collection`
  --> UP035.py:73:1
   |
71 | from typing import AsyncIterable
72 | from typing import Coroutine
73 | from typing import Collection
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74 | from typing import AsyncGenerator
75 | from typing import Reversible
   |
help: Import from `collections.abc`
   |
72 | from typing import Coroutine
   - from typing import Collection
73 + from collections.abc import Collection
74 | from typing import AsyncGenerator
   |

UP035 [*] Import from `collections.abc` instead: `AsyncGenerator`
  --> UP035.py:74:1
   |
72 | from typing import Coroutine
73 | from typing import Collection
74 | from typing import AsyncGenerator
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75 | from typing import Reversible
76 | from typing import Generator
   |
help: Import from `collections.abc`
   |
73 | from typing import Collection
   - from typing import AsyncGenerator
74 + from collections.abc import AsyncGenerator
75 | from typing import Reversible
   |

UP035 [*] Import from `collections.abc` instead: `Reversible`
  --> UP035.py:75:1
   |
73 | from typing import Collection
74 | from typing import AsyncGenerator
75 | from typing import Reversible
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76 | from typing import Generator
77 | from typing import Callable
   |
help: Import from `collections.abc`
   |
74 | from typing import AsyncGenerator
   - from typing import Reversible
75 + from collections.abc import Reversible
76 | from typing import Generator
   |

UP035 [*] Import from `collections.abc` instead: `Generator`
  --> UP035.py:76:1
   |
74 | from typing import AsyncGenerator
75 | from typing import Reversible
76 | from typing import Generator
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77 | from typing import Callable
78 | from typing import cast
   |
help: Import from `collections.abc`
   |
75 | from typing import Reversible
   - from typing import Generator
76 + from collections.abc import Generator
77 | from typing import Callable
   |

UP035 [*] Import from `collections.abc` instead: `Callable`
  --> UP035.py:77:1
   |
75 | from typing import Reversible
76 | from typing import Generator
77 | from typing import Callable
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
78 | from typing import cast
   |
help: Import from `collections.abc`
   |
76 | from typing import Generator
   - from typing import Callable
77 + from collections.abc import Callable
78 | from typing import cast
   |

UP035 [*] Import from `typing` instead: `SupportsIndex`
  --> UP035.py:84:1
   |
83 | # UP035 on py312+ only
84 | from typing_extensions import SupportsIndex
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85 |
86 | # UP035 on py312+ only
   |
help: Import from `typing`
   |
83 | # UP035 on py312+ only
   - from typing_extensions import SupportsIndex
84 + from typing import SupportsIndex
85 |
   |

UP035 [*] Import from `typing` instead: `NamedTuple`
  --> UP035.py:87:1
   |
86 | # UP035 on py312+ only
87 | from typing_extensions import NamedTuple
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88 |
89 | # UP035 on py312+ only: `typing_extensions` supports `frozen_default` (backported from 3.12).
   |
help: Import from `typing`
   |
86 | # UP035 on py312+ only
   - from typing_extensions import NamedTuple
87 + from typing import NamedTuple
88 |
   |

UP035 [*] Import from `typing` instead: `dataclass_transform`
  --> UP035.py:90:1
   |
89 | # UP035 on py312+ only: `typing_extensions` supports `frozen_default` (backported from 3.12).
90 | from typing_extensions import dataclass_transform
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91 |
92 | # UP035
   |
help: Import from `typing`
   |
89 | # UP035 on py312+ only: `typing_extensions` supports `frozen_default` (backported from 3.12).
   - from typing_extensions import dataclass_transform
90 + from typing import dataclass_transform
91 |
   |

UP035 [*] Import from `enum` instead: `StrEnum`
  --> UP035.py:93:1
   |
92 | # UP035
93 | from backports.strenum import StrEnum
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94 |
95 | # UP035
   |
help: Import from `enum`
   |
92 | # UP035
   - from backports.strenum import StrEnum
93 + from enum import StrEnum
94 |
   |

UP035 [*] Import from `typing` instead: `override`
  --> UP035.py:96:1
   |
95 | # UP035
96 | from typing_extensions import override
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97 |
98 | # UP035
   |
help: Import from `typing`
   |
95 | # UP035
   - from typing_extensions import override
96 + from typing import override
97 |
   |

UP035 [*] Import from `collections.abc` instead: `Buffer`
   --> UP035.py:99:1
    |
 98 | # UP035
 99 | from typing_extensions import Buffer
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100 |
101 | # UP035
    |
help: Import from `collections.abc`
    |
98  | # UP035
    - from typing_extensions import Buffer
99  + from collections.abc import Buffer
100 |
    |

UP035 [*] Import from `types` instead: `get_original_bases`
   --> UP035.py:102:1
    |
101 | # UP035
102 | from typing_extensions import get_original_bases
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103 |
104 | # UP035 on py313+ only
    |
help: Import from `types`
    |
101 | # UP035
    - from typing_extensions import get_original_bases
102 + from types import get_original_bases
103 |
    |

UP035 [*] Import from `typing` instead: `TypeVar`
   --> UP035.py:105:1
    |
104 | # UP035 on py313+ only
105 | from typing_extensions import TypeVar
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106 |
107 | # UP035 on py313+ only
    |
help: Import from `typing`
    |
104 | # UP035 on py313+ only
    - from typing_extensions import TypeVar
105 + from typing import TypeVar
106 |
    |

UP035 [*] Import from `types` instead: `CapsuleType`
   --> UP035.py:108:1
    |
107 | # UP035 on py313+ only
108 | from typing_extensions import CapsuleType
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109 |
110 | # UP035 on py313+ only
    |
help: Import from `types`
    |
107 | # UP035 on py313+ only
    - from typing_extensions import CapsuleType
108 + from types import CapsuleType
109 |
    |

UP035 [*] Import from `warnings` instead: `deprecated`
   --> UP035.py:111:1
    |
110 | # UP035 on py313+ only
111 | from typing_extensions import deprecated
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112 |
113 | # UP035 on py313+ only
    |
help: Import from `warnings`
    |
110 | # UP035 on py313+ only
    - from typing_extensions import deprecated
111 + from warnings import deprecated
112 |
    |

UP035 [*] Import from `typing` instead: `get_type_hints`
   --> UP035.py:114:1
    |
113 | # UP035 on py313+ only
114 | from typing_extensions import get_type_hints
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115 |
116 | # https://github.com/astral-sh/ruff/issues/15780
    |
help: Import from `typing`
    |
113 | # UP035 on py313+ only
    - from typing_extensions import get_type_hints
114 + from typing import get_type_hints
115 |
    |

UP035 [*] Import from `typing` instead: `BinaryIO`
   --> UP035.py:122:1
    |
121 | # UP035 on py37+ only
122 | from typing.io import BinaryIO
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123 |
124 | # UP035 on py37+ only
    |
help: Import from `typing`
    |
121 | # UP035 on py37+ only
    - from typing.io import BinaryIO
122 + from typing import BinaryIO
123 |
    |

UP035 [*] Import from `typing` instead: `IO`
   --> UP035.py:125:1
    |
124 | # UP035 on py37+ only
125 | from typing.io import IO
    | ^^^^^^^^^^^^^^^^^^^^^^^^
126 |
127 | # UP035 on py37+ only
    |
help: Import from `typing`
    |
124 | # UP035 on py37+ only
    - from typing.io import IO
125 + from typing import IO
126 |
    |

UP035 [*] Import from `typing` instead: `TextIO`
   --> UP035.py:128:1
    |
127 | # UP035 on py37+ only
128 | from typing.io import TextIO
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129 |
130 | # UP035 on py37+ only
    |
help: Import from `typing`
    |
127 | # UP035 on py37+ only
    - from typing.io import TextIO
128 + from typing import TextIO
129 |
    |

UP035 [*] Import from `re` instead: `Match`
   --> UP035.py:131:1
    |
130 | # UP035 on py37+ only
131 | from typing.re import Match
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
132 |
133 | # UP035 on py37+ only
    |
help: Import from `re`
    |
130 | # UP035 on py37+ only
    - from typing.re import Match
131 + from re import Match
132 |
    |

UP035 [*] Import from `re` instead: `Pattern`
   --> UP035.py:134:1
    |
133 | # UP035 on py37+ only
134 | from typing.re import Pattern
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
help: Import from `re`
    |
133 | # UP035 on py37+ only
    - from typing.re import Pattern
134 + from re import Pattern
    |
