-
Notifications
You must be signed in to change notification settings - Fork 903
/
ruff__rules__pyupgrade__tests__UP035.py.snap
992 lines (898 loc) · 30.2 KB
/
ruff__rules__pyupgrade__tests__UP035.py.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
---
source: crates/ruff/src/rules/pyupgrade/mod.rs
---
UP035.py:2:1: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
1 | # UP035
2 | from collections import Mapping
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
3 |
4 | from collections import Mapping as MAP
|
= help: Import from `collections.abc`
ℹ Suggested fix
1 1 | # UP035
2 |-from collections import Mapping
2 |+from collections.abc import Mapping
3 3 |
4 4 | from collections import Mapping as MAP
5 5 |
UP035.py:4:1: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
2 | from collections import Mapping
3 |
4 | from collections import Mapping as MAP
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
5 |
6 | from collections import Mapping, Sequence
|
= help: Import from `collections.abc`
ℹ Suggested fix
1 1 | # UP035
2 2 | from collections import Mapping
3 3 |
4 |-from collections import Mapping as MAP
4 |+from collections.abc import Mapping as MAP
5 5 |
6 6 | from collections import Mapping, Sequence
7 7 |
UP035.py:6:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence`
|
4 | from collections import Mapping as MAP
5 |
6 | from collections import Mapping, Sequence
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
7 |
8 | from collections import Counter, Mapping
|
= help: Import from `collections.abc`
ℹ Suggested fix
3 3 |
4 4 | from collections import Mapping as MAP
5 5 |
6 |-from collections import Mapping, Sequence
6 |+from collections.abc import Mapping, Sequence
7 7 |
8 8 | from collections import Counter, Mapping
9 9 |
UP035.py:8:1: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
6 | from collections import Mapping, Sequence
7 |
8 | from collections import Counter, Mapping
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
9 |
10 | from collections import (Counter, Mapping)
|
= help: Import from `collections.abc`
ℹ Suggested fix
5 5 |
6 6 | from collections import Mapping, Sequence
7 7 |
8 |-from collections import Counter, Mapping
8 |+from collections import Counter
9 |+from collections.abc import Mapping
9 10 |
10 11 | from collections import (Counter, Mapping)
11 12 |
UP035.py:10:1: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
8 | from collections import Counter, Mapping
9 |
10 | from collections import (Counter, Mapping)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
11 |
12 | from collections import (Counter,
|
= help: Import from `collections.abc`
ℹ Suggested fix
7 7 |
8 8 | from collections import Counter, Mapping
9 9 |
10 |-from collections import (Counter, Mapping)
10 |+from collections import (Counter)
11 |+from collections.abc import Mapping
11 12 |
12 13 | from collections import (Counter,
13 14 | Mapping)
UP035.py:12:1: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
10 | from collections import (Counter, Mapping)
11 |
12 | / from collections import (Counter,
13 | | Mapping)
| |_________________________________^ UP035
14 |
15 | from collections import Counter, \
|
= help: Import from `collections.abc`
ℹ Suggested fix
9 9 |
10 10 | from collections import (Counter, Mapping)
11 11 |
12 |-from collections import (Counter,
13 |- Mapping)
12 |+from collections import (Counter)
13 |+from collections.abc import Mapping
14 14 |
15 15 | from collections import Counter, \
16 16 | Mapping
UP035.py:15:1: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
13 | Mapping)
14 |
15 | / from collections import Counter, \
16 | | Mapping
| |________________________________^ UP035
17 |
18 | from collections import Counter, Mapping, Sequence
|
= help: Import from `collections.abc`
ℹ Suggested fix
12 12 | from collections import (Counter,
13 13 | Mapping)
14 14 |
15 |-from collections import Counter, \
16 |- Mapping
15 |+from collections import Counter
16 |+from collections.abc import Mapping
17 17 |
18 18 | from collections import Counter, Mapping, Sequence
19 19 |
UP035.py:18:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence`
|
16 | Mapping
17 |
18 | from collections import Counter, Mapping, Sequence
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
19 |
20 | from collections import Mapping as mapping, Counter
|
= help: Import from `collections.abc`
ℹ Suggested fix
15 15 | from collections import Counter, \
16 16 | Mapping
17 17 |
18 |-from collections import Counter, Mapping, Sequence
18 |+from collections import Counter
19 |+from collections.abc import Mapping, Sequence
19 20 |
20 21 | from collections import Mapping as mapping, Counter
21 22 |
UP035.py:20:1: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
18 | from collections import Counter, Mapping, Sequence
19 |
20 | from collections import Mapping as mapping, Counter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
21 |
22 | if True:
|
= help: Import from `collections.abc`
ℹ Suggested fix
17 17 |
18 18 | from collections import Counter, Mapping, Sequence
19 19 |
20 |-from collections import Mapping as mapping, Counter
20 |+from collections import Counter
21 |+from collections.abc import Mapping as mapping
21 22 |
22 23 | if True:
23 24 | from collections import Mapping, Counter
UP035.py:23:5: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
22 | if True:
23 | from collections import Mapping, Counter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
24 |
25 | if True:
|
= help: Import from `collections.abc`
ℹ Suggested fix
20 20 | from collections import Mapping as mapping, Counter
21 21 |
22 22 | if True:
23 |- from collections import Mapping, Counter
23 |+ from collections import Counter
24 |+ from collections.abc import Mapping
24 25 |
25 26 | if True:
26 27 | if True:
UP035.py:28:5: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
26 | if True:
27 | pass
28 | from collections import Mapping, Counter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
29 |
30 | if True: from collections import Mapping
|
= help: Import from `collections.abc`
ℹ Suggested fix
25 25 | if True:
26 26 | if True:
27 27 | pass
28 |- from collections import Mapping, Counter
28 |+ from collections import Counter
29 |+ from collections.abc import Mapping
29 30 |
30 31 | if True: from collections import Mapping
31 32 |
UP035.py:30:10: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
28 | from collections import Mapping, Counter
29 |
30 | if True: from collections import Mapping
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
31 |
32 | import os
|
= help: Import from `collections.abc`
ℹ Suggested fix
27 27 | pass
28 28 | from collections import Mapping, Counter
29 29 |
30 |-if True: from collections import Mapping
30 |+if True: from collections.abc import Mapping
31 31 |
32 32 | import os
33 33 | from collections import Counter, Mapping
UP035.py:33:1: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
32 | import os
33 | from collections import Counter, Mapping
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
34 | import sys
|
= help: Import from `collections.abc`
ℹ Suggested fix
30 30 | if True: from collections import Mapping
31 31 |
32 32 | import os
33 |-from collections import Counter, Mapping
33 |+from collections import Counter
34 |+from collections.abc import Mapping
34 35 | import sys
35 36 |
36 37 | if True:
UP035.py:37:5: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Callable`
|
36 | if True:
37 | from collections import (
| _____^
38 | | Mapping,
39 | | Callable,
40 | | Bad,
41 | | Good,
42 | | )
| |_____^ UP035
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
|
= help: Import from `collections.abc`
ℹ Suggested fix
35 35 |
36 36 | if True:
37 37 | from collections import (
38 |- Mapping,
39 |- Callable,
40 38 | Bad,
41 39 | Good,
42 40 | )
41 |+ from collections.abc import Mapping, Callable
43 42 |
44 43 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
45 44 |
UP035.py:44:1: UP035 [*] Import from `collections.abc` instead: `Callable`
|
42 | )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
45 |
46 | if True: from collections import (
|
= help: Import from `collections.abc`
ℹ Suggested fix
41 41 | Good,
42 42 | )
43 43 |
44 |-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
45 46 |
46 47 | if True: from collections import (
47 48 | Mapping, Counter)
UP035.py:44:1: UP035 [*] Import from `collections` instead: `OrderedDict`
|
42 | )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
45 |
46 | if True: from collections import (
|
= help: Import from `collections`
ℹ Suggested fix
41 41 | Good,
42 42 | )
43 43 |
44 |-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
45 46 |
46 47 | if True: from collections import (
47 48 | Mapping, Counter)
UP035.py:44:1: UP035 [*] Import from `re` instead: `Match`, `Pattern`
|
42 | )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
45 |
46 | if True: from collections import (
|
= help: Import from `re`
ℹ Suggested fix
41 41 | Good,
42 42 | )
43 43 |
44 |-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
45 46 |
46 47 | if True: from collections import (
47 48 | Mapping, Counter)
UP035.py:44:1: UP035 `typing.List` is deprecated, use `list` instead
|
42 | )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
45 |
46 | if True: from collections import (
|
UP035.py:44:1: UP035 `typing.AbstractSet` is deprecated, use `collections.abc.Set` instead
|
42 | )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
45 |
46 | if True: from collections import (
|
UP035.py:44:1: UP035 `typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead
|
42 | )
43 |
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
45 |
46 | if True: from collections import (
|
UP035.py:46:10: UP035 Import from `collections.abc` instead: `Mapping`
|
44 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager
45 |
46 | if True: from collections import (
| __________^
47 | | Mapping, Counter)
| |_____________________^ UP035
48 |
49 | # Bad imports from PYI027 that are now handled by PYI022 (UP035)
|
= help: Import from `collections.abc`
UP035.py:50:1: UP035 `typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead
|
49 | # Bad imports from PYI027 that are now handled by PYI022 (UP035)
50 | from typing import ContextManager
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
51 | from typing import OrderedDict
52 | from typing_extensions import OrderedDict
|
UP035.py:51:1: UP035 [*] Import from `collections` instead: `OrderedDict`
|
49 | # Bad imports from PYI027 that are now handled by PYI022 (UP035)
50 | from typing import ContextManager
51 | from typing import OrderedDict
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
52 | from typing_extensions import OrderedDict
53 | from typing import Callable
|
= help: Import from `collections`
ℹ Suggested fix
48 48 |
49 49 | # Bad imports from PYI027 that are now handled by PYI022 (UP035)
50 50 | from typing import ContextManager
51 |-from typing import OrderedDict
51 |+from collections import OrderedDict
52 52 | from typing_extensions import OrderedDict
53 53 | from typing import Callable
54 54 | from typing import ByteString
UP035.py:52:1: UP035 [*] Import from `typing` instead: `OrderedDict`
|
50 | from typing import ContextManager
51 | from typing import OrderedDict
52 | from typing_extensions import OrderedDict
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
53 | from typing import Callable
54 | from typing import ByteString
|
= help: Import from `typing`
ℹ Suggested fix
49 49 | # Bad imports from PYI027 that are now handled by PYI022 (UP035)
50 50 | from typing import ContextManager
51 51 | from typing import OrderedDict
52 |-from typing_extensions import OrderedDict
52 |+from typing import OrderedDict
53 53 | from typing import Callable
54 54 | from typing import ByteString
55 55 | from typing import Container
UP035.py:53:1: UP035 [*] Import from `collections.abc` instead: `Callable`
|
51 | from typing import OrderedDict
52 | from typing_extensions import OrderedDict
53 | from typing import Callable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
54 | from typing import ByteString
55 | from typing import Container
|
= help: Import from `collections.abc`
ℹ Suggested fix
50 50 | from typing import ContextManager
51 51 | from typing import OrderedDict
52 52 | from typing_extensions import OrderedDict
53 |-from typing import Callable
53 |+from collections.abc import Callable
54 54 | from typing import ByteString
55 55 | from typing import Container
56 56 | from typing import Hashable
UP035.py:54:1: UP035 [*] Import from `collections.abc` instead: `ByteString`
|
52 | from typing_extensions import OrderedDict
53 | from typing import Callable
54 | from typing import ByteString
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
55 | from typing import Container
56 | from typing import Hashable
|
= help: Import from `collections.abc`
ℹ Suggested fix
51 51 | from typing import OrderedDict
52 52 | from typing_extensions import OrderedDict
53 53 | from typing import Callable
54 |-from typing import ByteString
54 |+from collections.abc import ByteString
55 55 | from typing import Container
56 56 | from typing import Hashable
57 57 | from typing import ItemsView
UP035.py:55:1: UP035 [*] Import from `collections.abc` instead: `Container`
|
53 | from typing import Callable
54 | from typing import ByteString
55 | from typing import Container
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
56 | from typing import Hashable
57 | from typing import ItemsView
|
= help: Import from `collections.abc`
ℹ Suggested fix
52 52 | from typing_extensions import OrderedDict
53 53 | from typing import Callable
54 54 | from typing import ByteString
55 |-from typing import Container
55 |+from collections.abc import Container
56 56 | from typing import Hashable
57 57 | from typing import ItemsView
58 58 | from typing import Iterable
UP035.py:56:1: UP035 [*] Import from `collections.abc` instead: `Hashable`
|
54 | from typing import ByteString
55 | from typing import Container
56 | from typing import Hashable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
57 | from typing import ItemsView
58 | from typing import Iterable
|
= help: Import from `collections.abc`
ℹ Suggested fix
53 53 | from typing import Callable
54 54 | from typing import ByteString
55 55 | from typing import Container
56 |-from typing import Hashable
56 |+from collections.abc import Hashable
57 57 | from typing import ItemsView
58 58 | from typing import Iterable
59 59 | from typing import Iterator
UP035.py:57:1: UP035 [*] Import from `collections.abc` instead: `ItemsView`
|
55 | from typing import Container
56 | from typing import Hashable
57 | from typing import ItemsView
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
58 | from typing import Iterable
59 | from typing import Iterator
|
= help: Import from `collections.abc`
ℹ Suggested fix
54 54 | from typing import ByteString
55 55 | from typing import Container
56 56 | from typing import Hashable
57 |-from typing import ItemsView
57 |+from collections.abc import ItemsView
58 58 | from typing import Iterable
59 59 | from typing import Iterator
60 60 | from typing import KeysView
UP035.py:58:1: UP035 [*] Import from `collections.abc` instead: `Iterable`
|
56 | from typing import Hashable
57 | from typing import ItemsView
58 | from typing import Iterable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
59 | from typing import Iterator
60 | from typing import KeysView
|
= help: Import from `collections.abc`
ℹ Suggested fix
55 55 | from typing import Container
56 56 | from typing import Hashable
57 57 | from typing import ItemsView
58 |-from typing import Iterable
58 |+from collections.abc import Iterable
59 59 | from typing import Iterator
60 60 | from typing import KeysView
61 61 | from typing import Mapping
UP035.py:59:1: UP035 [*] Import from `collections.abc` instead: `Iterator`
|
57 | from typing import ItemsView
58 | from typing import Iterable
59 | from typing import Iterator
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
60 | from typing import KeysView
61 | from typing import Mapping
|
= help: Import from `collections.abc`
ℹ Suggested fix
56 56 | from typing import Hashable
57 57 | from typing import ItemsView
58 58 | from typing import Iterable
59 |-from typing import Iterator
59 |+from collections.abc import Iterator
60 60 | from typing import KeysView
61 61 | from typing import Mapping
62 62 | from typing import MappingView
UP035.py:60:1: UP035 [*] Import from `collections.abc` instead: `KeysView`
|
58 | from typing import Iterable
59 | from typing import Iterator
60 | from typing import KeysView
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
61 | from typing import Mapping
62 | from typing import MappingView
|
= help: Import from `collections.abc`
ℹ Suggested fix
57 57 | from typing import ItemsView
58 58 | from typing import Iterable
59 59 | from typing import Iterator
60 |-from typing import KeysView
60 |+from collections.abc import KeysView
61 61 | from typing import Mapping
62 62 | from typing import MappingView
63 63 | from typing import MutableMapping
UP035.py:61:1: UP035 [*] Import from `collections.abc` instead: `Mapping`
|
59 | from typing import Iterator
60 | from typing import KeysView
61 | from typing import Mapping
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
62 | from typing import MappingView
63 | from typing import MutableMapping
|
= help: Import from `collections.abc`
ℹ Suggested fix
58 58 | from typing import Iterable
59 59 | from typing import Iterator
60 60 | from typing import KeysView
61 |-from typing import Mapping
61 |+from collections.abc import Mapping
62 62 | from typing import MappingView
63 63 | from typing import MutableMapping
64 64 | from typing import MutableSequence
UP035.py:62:1: UP035 [*] Import from `collections.abc` instead: `MappingView`
|
60 | from typing import KeysView
61 | from typing import Mapping
62 | from typing import MappingView
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
63 | from typing import MutableMapping
64 | from typing import MutableSequence
|
= help: Import from `collections.abc`
ℹ Suggested fix
59 59 | from typing import Iterator
60 60 | from typing import KeysView
61 61 | from typing import Mapping
62 |-from typing import MappingView
62 |+from collections.abc import MappingView
63 63 | from typing import MutableMapping
64 64 | from typing import MutableSequence
65 65 | from typing import MutableSet
UP035.py:63:1: UP035 [*] Import from `collections.abc` instead: `MutableMapping`
|
61 | from typing import Mapping
62 | from typing import MappingView
63 | from typing import MutableMapping
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
64 | from typing import MutableSequence
65 | from typing import MutableSet
|
= help: Import from `collections.abc`
ℹ Suggested fix
60 60 | from typing import KeysView
61 61 | from typing import Mapping
62 62 | from typing import MappingView
63 |-from typing import MutableMapping
63 |+from collections.abc import MutableMapping
64 64 | from typing import MutableSequence
65 65 | from typing import MutableSet
66 66 | from typing import Sequence
UP035.py:64:1: UP035 [*] Import from `collections.abc` instead: `MutableSequence`
|
62 | from typing import MappingView
63 | from typing import MutableMapping
64 | from typing import MutableSequence
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
65 | from typing import MutableSet
66 | from typing import Sequence
|
= help: Import from `collections.abc`
ℹ Suggested fix
61 61 | from typing import Mapping
62 62 | from typing import MappingView
63 63 | from typing import MutableMapping
64 |-from typing import MutableSequence
64 |+from collections.abc import MutableSequence
65 65 | from typing import MutableSet
66 66 | from typing import Sequence
67 67 | from typing import Sized
UP035.py:65:1: UP035 [*] Import from `collections.abc` instead: `MutableSet`
|
63 | from typing import MutableMapping
64 | from typing import MutableSequence
65 | from typing import MutableSet
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
66 | from typing import Sequence
67 | from typing import Sized
|
= help: Import from `collections.abc`
ℹ Suggested fix
62 62 | from typing import MappingView
63 63 | from typing import MutableMapping
64 64 | from typing import MutableSequence
65 |-from typing import MutableSet
65 |+from collections.abc import MutableSet
66 66 | from typing import Sequence
67 67 | from typing import Sized
68 68 | from typing import ValuesView
UP035.py:66:1: UP035 [*] Import from `collections.abc` instead: `Sequence`
|
64 | from typing import MutableSequence
65 | from typing import MutableSet
66 | from typing import Sequence
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
67 | from typing import Sized
68 | from typing import ValuesView
|
= help: Import from `collections.abc`
ℹ Suggested fix
63 63 | from typing import MutableMapping
64 64 | from typing import MutableSequence
65 65 | from typing import MutableSet
66 |-from typing import Sequence
66 |+from collections.abc import Sequence
67 67 | from typing import Sized
68 68 | from typing import ValuesView
69 69 | from typing import Awaitable
UP035.py:67:1: UP035 [*] Import from `collections.abc` instead: `Sized`
|
65 | from typing import MutableSet
66 | from typing import Sequence
67 | from typing import Sized
| ^^^^^^^^^^^^^^^^^^^^^^^^ UP035
68 | from typing import ValuesView
69 | from typing import Awaitable
|
= help: Import from `collections.abc`
ℹ Suggested fix
64 64 | from typing import MutableSequence
65 65 | from typing import MutableSet
66 66 | from typing import Sequence
67 |-from typing import Sized
67 |+from collections.abc import Sized
68 68 | from typing import ValuesView
69 69 | from typing import Awaitable
70 70 | from typing import AsyncIterator
UP035.py:68:1: UP035 [*] Import from `collections.abc` instead: `ValuesView`
|
66 | from typing import Sequence
67 | from typing import Sized
68 | from typing import ValuesView
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
69 | from typing import Awaitable
70 | from typing import AsyncIterator
|
= help: Import from `collections.abc`
ℹ Suggested fix
65 65 | from typing import MutableSet
66 66 | from typing import Sequence
67 67 | from typing import Sized
68 |-from typing import ValuesView
68 |+from collections.abc import ValuesView
69 69 | from typing import Awaitable
70 70 | from typing import AsyncIterator
71 71 | from typing import AsyncIterable
UP035.py:69:1: UP035 [*] Import from `collections.abc` instead: `Awaitable`
|
67 | from typing import Sized
68 | from typing import ValuesView
69 | from typing import Awaitable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
70 | from typing import AsyncIterator
71 | from typing import AsyncIterable
|
= help: Import from `collections.abc`
ℹ Suggested fix
66 66 | from typing import Sequence
67 67 | from typing import Sized
68 68 | from typing import ValuesView
69 |-from typing import Awaitable
69 |+from collections.abc import Awaitable
70 70 | from typing import AsyncIterator
71 71 | from typing import AsyncIterable
72 72 | from typing import Coroutine
UP035.py:70:1: UP035 [*] Import from `collections.abc` instead: `AsyncIterator`
|
68 | from typing import ValuesView
69 | from typing import Awaitable
70 | from typing import AsyncIterator
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
71 | from typing import AsyncIterable
72 | from typing import Coroutine
|
= help: Import from `collections.abc`
ℹ Suggested fix
67 67 | from typing import Sized
68 68 | from typing import ValuesView
69 69 | from typing import Awaitable
70 |-from typing import AsyncIterator
70 |+from collections.abc import AsyncIterator
71 71 | from typing import AsyncIterable
72 72 | from typing import Coroutine
73 73 | from typing import Collection
UP035.py:71:1: UP035 [*] Import from `collections.abc` instead: `AsyncIterable`
|
69 | from typing import Awaitable
70 | from typing import AsyncIterator
71 | from typing import AsyncIterable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
72 | from typing import Coroutine
73 | from typing import Collection
|
= help: Import from `collections.abc`
ℹ Suggested fix
68 68 | from typing import ValuesView
69 69 | from typing import Awaitable
70 70 | from typing import AsyncIterator
71 |-from typing import AsyncIterable
71 |+from collections.abc import AsyncIterable
72 72 | from typing import Coroutine
73 73 | from typing import Collection
74 74 | from typing import AsyncGenerator
UP035.py:72:1: UP035 [*] Import from `collections.abc` instead: `Coroutine`
|
70 | from typing import AsyncIterator
71 | from typing import AsyncIterable
72 | from typing import Coroutine
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
73 | from typing import Collection
74 | from typing import AsyncGenerator
|
= help: Import from `collections.abc`
ℹ Suggested fix
69 69 | from typing import Awaitable
70 70 | from typing import AsyncIterator
71 71 | from typing import AsyncIterable
72 |-from typing import Coroutine
72 |+from collections.abc import Coroutine
73 73 | from typing import Collection
74 74 | from typing import AsyncGenerator
75 75 | from typing import Reversible
UP035.py:73:1: UP035 [*] Import from `collections.abc` instead: `Collection`
|
71 | from typing import AsyncIterable
72 | from typing import Coroutine
73 | from typing import Collection
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
74 | from typing import AsyncGenerator
75 | from typing import Reversible
|
= help: Import from `collections.abc`
ℹ Suggested fix
70 70 | from typing import AsyncIterator
71 71 | from typing import AsyncIterable
72 72 | from typing import Coroutine
73 |-from typing import Collection
73 |+from collections.abc import Collection
74 74 | from typing import AsyncGenerator
75 75 | from typing import Reversible
76 76 | from typing import Generator
UP035.py:74:1: UP035 [*] Import from `collections.abc` instead: `AsyncGenerator`
|
72 | from typing import Coroutine
73 | from typing import Collection
74 | from typing import AsyncGenerator
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
75 | from typing import Reversible
76 | from typing import Generator
|
= help: Import from `collections.abc`
ℹ Suggested fix
71 71 | from typing import AsyncIterable
72 72 | from typing import Coroutine
73 73 | from typing import Collection
74 |-from typing import AsyncGenerator
74 |+from collections.abc import AsyncGenerator
75 75 | from typing import Reversible
76 76 | from typing import Generator
77 77 |
UP035.py:75:1: UP035 [*] Import from `collections.abc` instead: `Reversible`
|
73 | from typing import Collection
74 | from typing import AsyncGenerator
75 | from typing import Reversible
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
76 | from typing import Generator
|
= help: Import from `collections.abc`
ℹ Suggested fix
72 72 | from typing import Coroutine
73 73 | from typing import Collection
74 74 | from typing import AsyncGenerator
75 |-from typing import Reversible
75 |+from collections.abc import Reversible
76 76 | from typing import Generator
77 77 |
78 78 | # OK
UP035.py:76:1: UP035 [*] Import from `collections.abc` instead: `Generator`
|
74 | from typing import AsyncGenerator
75 | from typing import Reversible
76 | from typing import Generator
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
77 |
78 | # OK
|
= help: Import from `collections.abc`
ℹ Suggested fix
73 73 | from typing import Collection
74 74 | from typing import AsyncGenerator
75 75 | from typing import Reversible
76 |-from typing import Generator
76 |+from collections.abc import Generator
77 77 |
78 78 | # OK
79 79 | from a import b
UP035.py:88:1: UP035 [*] Import from `typing` instead: `dataclass_transform`
|
87 | # Ok: `typing_extensions` supports `frozen_default` (backported from 3.12).
88 | from typing_extensions import dataclass_transform
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
|
= help: Import from `typing`
ℹ Suggested fix
85 85 | from typing_extensions import NamedTuple
86 86 |
87 87 | # Ok: `typing_extensions` supports `frozen_default` (backported from 3.12).
88 |-from typing_extensions import dataclass_transform
88 |+from typing import dataclass_transform