---
source: crates/ruff_linter/src/rules/flake8_tidy_imports/mod.rs
---
TID255 [*] Lazy import `foo` is resolved immediately
  --> TID255.py:8:8
   |
 6 | lazy import multi_one, multi_two
 7 |
 8 | base = foo.Base
   |        ^^^
 9 | component = Component
10 | aliased = alias.Member
   |
help: Convert to an eager import
  |
  - lazy import foo
1 + import foo
2 | lazy import package.submodule
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `Component` is resolved immediately
  --> TID255.py:9:13
   |
 8 | base = foo.Base
 9 | component = Component
   |             ^^^^^^^^^
10 | aliased = alias.Member
11 | submodule = package.submodule.Member
   |
help: Convert to an eager import
  |
3 | lazy import aliased as alias
  - lazy from library import Component
4 + from library import Component
5 | lazy from library import Other as Renamed
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `alias` is resolved immediately
  --> TID255.py:10:11
   |
 8 | base = foo.Base
 9 | component = Component
10 | aliased = alias.Member
   |           ^^^^^
11 | submodule = package.submodule.Member
12 | multi_value = multi_one.Value
   |
help: Convert to an eager import
  |
2 | lazy import package.submodule
  - lazy import aliased as alias
3 + import aliased as alias
4 | lazy from library import Component
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `package` is resolved immediately
  --> TID255.py:11:13
   |
 9 | component = Component
10 | aliased = alias.Member
11 | submodule = package.submodule.Member
   |             ^^^^^^^
12 | multi_value = multi_one.Value
   |
help: Convert to an eager import
  |
1 | lazy import foo
  - lazy import package.submodule
2 + import package.submodule
3 | lazy import aliased as alias
  |
note: This is an unsafe fix and may change runtime behavior

TID255 Lazy import `multi_one` is resolved immediately
  --> TID255.py:12:15
   |
10 | aliased = alias.Member
11 | submodule = package.submodule.Member
12 | multi_value = multi_one.Value
   |               ^^^^^^^^^
13 |
14 | if foo.ENABLED:
   |

TID255 [*] Lazy import `foo` is resolved immediately
  --> TID255.py:14:4
   |
12 | multi_value = multi_one.Value
13 |
14 | if foo.ENABLED:
   |    ^^^
15 |     pass
   |
help: Convert to an eager import
  |
  - lazy import foo
1 + import foo
2 | lazy import package.submodule
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `Component` is resolved immediately
  --> TID255.py:21:16
   |
20 | try:
21 |     try_body = Component
   |                ^^^^^^^^^
22 | except Exception:
23 |     handler = foo.Error
   |
help: Convert to an eager import
  |
3 | lazy import aliased as alias
  - lazy from library import Component
4 + from library import Component
5 | lazy from library import Other as Renamed
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `foo` is resolved immediately
  --> TID255.py:26:15
   |
26 | class Derived(foo.Base):
   |               ^^^
27 |     component = Component
   |
help: Convert to an eager import
  |
  - lazy import foo
1 + import foo
2 | lazy import package.submodule
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `Component` is resolved immediately
  --> TID255.py:27:17
   |
26 | class Derived(foo.Base):
27 |     component = Component
   |                 ^^^^^^^^^
28 |
29 |     if condition:
   |
help: Convert to an eager import
  |
3 | lazy import aliased as alias
  - lazy from library import Component
4 + from library import Component
5 | lazy from library import Other as Renamed
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `Renamed` is resolved immediately
  --> TID255.py:36:22
   |
36 | def function(default=Renamed):
   |                      ^^^^^^^
37 |     return foo.Value
   |
help: Convert to an eager import
  |
4 | lazy from library import Component
  - lazy from library import Other as Renamed
5 + from library import Other as Renamed
6 | lazy import multi_one, multi_two
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `foo` is resolved immediately
  --> TID255.py:42:16
   |
40 | type Alias = foo.Type
41 |
42 | list_values = [foo.Value for _ in range(1)]
   |                ^^^
43 | set_values = {Component for _ in range(1)}
44 | dict_values = {foo.Key: Component for _ in range(1)}
   |
help: Convert to an eager import
  |
  - lazy import foo
1 + import foo
2 | lazy import package.submodule
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `Component` is resolved immediately
  --> TID255.py:43:15
   |
42 | list_values = [foo.Value for _ in range(1)]
43 | set_values = {Component for _ in range(1)}
   |               ^^^^^^^^^
44 | dict_values = {foo.Key: Component for _ in range(1)}
45 | generator_values = (foo.Value for _ in range(1))
   |
help: Convert to an eager import
  |
3 | lazy import aliased as alias
  - lazy from library import Component
4 + from library import Component
5 | lazy from library import Other as Renamed
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `foo` is resolved immediately
  --> TID255.py:44:16
   |
42 | list_values = [foo.Value for _ in range(1)]
43 | set_values = {Component for _ in range(1)}
44 | dict_values = {foo.Key: Component for _ in range(1)}
   |                ^^^
45 | generator_values = (foo.Value for _ in range(1))
   |
help: Convert to an eager import
  |
  - lazy import foo
1 + import foo
2 | lazy import package.submodule
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `Component` is resolved immediately
  --> TID255.py:44:25
   |
42 | list_values = [foo.Value for _ in range(1)]
43 | set_values = {Component for _ in range(1)}
44 | dict_values = {foo.Key: Component for _ in range(1)}
   |                         ^^^^^^^^^
45 | generator_values = (foo.Value for _ in range(1))
   |
help: Convert to an eager import
  |
3 | lazy import aliased as alias
  - lazy from library import Component
4 + from library import Component
5 | lazy from library import Other as Renamed
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `foo` is resolved immediately
  --> TID255.py:48:27
   |
47 | # TODO(charlie): Avoid flagging references behind expression-level control flow.
48 | short_circuit = False and foo.Value
   |                           ^^^
49 | conditional_expression = foo.Value if enabled else None
   |
help: Convert to an eager import
  |
  - lazy import foo
1 + import foo
2 | lazy import package.submodule
  |
note: This is an unsafe fix and may change runtime behavior

TID255 [*] Lazy import `foo` is resolved immediately
  --> TID255.py:49:26
   |
47 | # TODO(charlie): Avoid flagging references behind expression-level control flow.
48 | short_circuit = False and foo.Value
49 | conditional_expression = foo.Value if enabled else None
   |                          ^^^
50 |
51 | if TYPE_CHECKING:
   |
help: Convert to an eager import
  |
  - lazy import foo
1 + import foo
2 | lazy import package.submodule
  |
note: This is an unsafe fix and may change runtime behavior
