1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-23 20:39:01 +00:00

Improve loops and lists (#113269)

* Enable PERF

* Enable PERF rule

* Enable PERF rule

* Don't enable flag yet
This commit is contained in:
Joost Lekkerkerker
2024-03-14 10:22:20 +01:00
committed by GitHub
parent 8a98fb7cfd
commit 05172d8e4d
30 changed files with 125 additions and 172 deletions

View File

@@ -2397,9 +2397,9 @@ async def test_cached_entity_property_class_attribute(hass: HomeAssistant) -> No
EntityWithClassAttribute4,
)
entities: list[tuple[entity.Entity, entity.Entity]] = []
for cls in classes:
entities.append((cls(), cls()))
entities: list[tuple[entity.Entity, entity.Entity]] = [
(cls(), cls()) for cls in classes
]
for ent in entities:
assert getattr(ent[0], property) == values[0]