Commit 972624e
committed
Fix mypy errors in sample_get_device.py loop variable shadowing
Reusing the loop variable 'item' across four for-loops over different
ItemPaged[T] types caused mypy to infer 'item' as Device from the first
loop, then fail on each subsequent loop because Group / DeviceClass /
DeviceClassSubgroupUpdatableDevices are not assignable to Device.
Use distinct loop variable names (device, group_item, device_class,
best_update) so each iteration is type-checked independently.1 parent ec6abdb commit 972624e
1 file changed
Lines changed: 10 additions & 10 deletions
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
0 commit comments