faster-eth-abi 5.2.14__cp313-cp313-macosx_11_0_arm64.whl → 5.2.15__cp313-cp313-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of faster-eth-abi might be problematic. Click here for more details.

faster_eth_abi/codec.py CHANGED
@@ -1,7 +1,10 @@
1
+ # mypy: disable-error-code="overload-overlap"
1
2
  from typing import (
2
3
  Any,
3
4
  Iterable,
4
5
  Tuple,
6
+ Union,
7
+ overload,
5
8
  )
6
9
 
7
10
  from eth_typing.abi import (
@@ -23,6 +26,15 @@ from faster_eth_abi.exceptions import (
23
26
  from faster_eth_abi.registry import (
24
27
  ABIRegistry,
25
28
  )
29
+ from faster_eth_abi.typing import (
30
+ BoolTypeStr,
31
+ BytesTypeStr,
32
+ IntTypeStr,
33
+ StringTypeStr,
34
+ UintTypeStr,
35
+ )
36
+
37
+ DecodesToIntTypeStr = Union[UintTypeStr, IntTypeStr]
26
38
 
27
39
 
28
40
  class BaseABICoder:
@@ -112,6 +124,1544 @@ class ABIDecoder(BaseABICoder):
112
124
 
113
125
  stream_class = ContextFramesBytesIO
114
126
 
127
+ # raw tuple types, same type
128
+
129
+ # len == 1
130
+
131
+ @overload
132
+ def decode(
133
+ self,
134
+ types: Tuple[BytesTypeStr],
135
+ data: Decodable,
136
+ strict: bool = True,
137
+ ) -> Tuple[bytes]:
138
+ ...
139
+
140
+ @overload
141
+ def decode(
142
+ self,
143
+ types: Tuple[StringTypeStr],
144
+ data: Decodable,
145
+ strict: bool = True,
146
+ ) -> Tuple[str]:
147
+ ...
148
+
149
+ @overload
150
+ def decode(
151
+ self,
152
+ types: Tuple[DecodesToIntTypeStr],
153
+ data: Decodable,
154
+ strict: bool = True,
155
+ ) -> Tuple[int]:
156
+ ...
157
+
158
+ @overload
159
+ def decode(
160
+ self,
161
+ types: Tuple[BoolTypeStr],
162
+ data: Decodable,
163
+ strict: bool = True,
164
+ ) -> Tuple[bool]:
165
+ ...
166
+
167
+ # len == 2
168
+
169
+ @overload
170
+ def decode(
171
+ self,
172
+ types: Tuple[BytesTypeStr, BytesTypeStr],
173
+ data: Decodable,
174
+ strict: bool = True,
175
+ ) -> Tuple[bytes, bytes]:
176
+ ...
177
+
178
+ @overload
179
+ def decode(
180
+ self,
181
+ types: Tuple[BytesTypeStr, StringTypeStr],
182
+ data: Decodable,
183
+ strict: bool = True,
184
+ ) -> Tuple[bytes, str]:
185
+ ...
186
+
187
+ @overload
188
+ def decode(
189
+ self,
190
+ types: Tuple[BytesTypeStr, DecodesToIntTypeStr],
191
+ data: Decodable,
192
+ strict: bool = True,
193
+ ) -> Tuple[bytes, int]:
194
+ ...
195
+
196
+ @overload
197
+ def decode(
198
+ self,
199
+ types: Tuple[BytesTypeStr, BoolTypeStr],
200
+ data: Decodable,
201
+ strict: bool = True,
202
+ ) -> Tuple[bytes, bool]:
203
+ ...
204
+
205
+ @overload
206
+ def decode(
207
+ self,
208
+ types: Tuple[BytesTypeStr, TypeStr],
209
+ data: Decodable,
210
+ strict: bool = True,
211
+ ) -> Tuple[bytes, Any]:
212
+ ...
213
+
214
+ @overload
215
+ def decode(
216
+ self,
217
+ types: Tuple[StringTypeStr, BytesTypeStr],
218
+ data: Decodable,
219
+ strict: bool = True,
220
+ ) -> Tuple[str, bytes]:
221
+ ...
222
+
223
+ @overload
224
+ def decode(
225
+ self,
226
+ types: Tuple[StringTypeStr, StringTypeStr],
227
+ data: Decodable,
228
+ strict: bool = True,
229
+ ) -> Tuple[str, str]:
230
+ ...
231
+
232
+ @overload
233
+ def decode(
234
+ self,
235
+ types: Tuple[StringTypeStr, DecodesToIntTypeStr],
236
+ data: Decodable,
237
+ strict: bool = True,
238
+ ) -> Tuple[str, int]:
239
+ ...
240
+
241
+ @overload
242
+ def decode(
243
+ self,
244
+ types: Tuple[StringTypeStr, BoolTypeStr],
245
+ data: Decodable,
246
+ strict: bool = True,
247
+ ) -> Tuple[str, bool]:
248
+ ...
249
+
250
+ @overload
251
+ def decode(
252
+ self,
253
+ types: Tuple[StringTypeStr, TypeStr],
254
+ data: Decodable,
255
+ strict: bool = True,
256
+ ) -> Tuple[str, Any]:
257
+ ...
258
+
259
+ @overload
260
+ def decode(
261
+ self,
262
+ types: Tuple[DecodesToIntTypeStr, BytesTypeStr],
263
+ data: Decodable,
264
+ strict: bool = True,
265
+ ) -> Tuple[int, bytes]:
266
+ ...
267
+
268
+ @overload
269
+ def decode(
270
+ self,
271
+ types: Tuple[DecodesToIntTypeStr, StringTypeStr],
272
+ data: Decodable,
273
+ strict: bool = True,
274
+ ) -> Tuple[int, str]:
275
+ ...
276
+
277
+ @overload
278
+ def decode(
279
+ self,
280
+ types: Tuple[DecodesToIntTypeStr, DecodesToIntTypeStr],
281
+ data: Decodable,
282
+ strict: bool = True,
283
+ ) -> Tuple[int, int]:
284
+ ...
285
+
286
+ @overload
287
+ def decode(
288
+ self,
289
+ types: Tuple[DecodesToIntTypeStr, BoolTypeStr],
290
+ data: Decodable,
291
+ strict: bool = True,
292
+ ) -> Tuple[int, bool]:
293
+ ...
294
+
295
+ @overload
296
+ def decode(
297
+ self,
298
+ types: Tuple[DecodesToIntTypeStr, TypeStr],
299
+ data: Decodable,
300
+ strict: bool = True,
301
+ ) -> Tuple[int, Any]:
302
+ ...
303
+
304
+ @overload
305
+ def decode(
306
+ self,
307
+ types: Tuple[BoolTypeStr, BytesTypeStr],
308
+ data: Decodable,
309
+ strict: bool = True,
310
+ ) -> Tuple[bool, bytes]:
311
+ ...
312
+
313
+ @overload
314
+ def decode(
315
+ self,
316
+ types: Tuple[BoolTypeStr, StringTypeStr],
317
+ data: Decodable,
318
+ strict: bool = True,
319
+ ) -> Tuple[bool, str]:
320
+ ...
321
+
322
+ @overload
323
+ def decode(
324
+ self,
325
+ types: Tuple[BoolTypeStr, DecodesToIntTypeStr],
326
+ data: Decodable,
327
+ strict: bool = True,
328
+ ) -> Tuple[bool, int]:
329
+ ...
330
+
331
+ @overload
332
+ def decode(
333
+ self,
334
+ types: Tuple[BoolTypeStr, BoolTypeStr],
335
+ data: Decodable,
336
+ strict: bool = True,
337
+ ) -> Tuple[bool, bool]:
338
+ ...
339
+
340
+ @overload
341
+ def decode(
342
+ self,
343
+ types: Tuple[BoolTypeStr, TypeStr],
344
+ data: Decodable,
345
+ strict: bool = True,
346
+ ) -> Tuple[bool, Any]:
347
+ ...
348
+
349
+ @overload
350
+ def decode(
351
+ self,
352
+ types: Tuple[TypeStr, BytesTypeStr],
353
+ data: Decodable,
354
+ strict: bool = True,
355
+ ) -> Tuple[Any, bytes]:
356
+ ...
357
+
358
+ @overload
359
+ def decode(
360
+ self,
361
+ types: Tuple[TypeStr, StringTypeStr],
362
+ data: Decodable,
363
+ strict: bool = True,
364
+ ) -> Tuple[Any, str]:
365
+ ...
366
+
367
+ @overload
368
+ def decode(
369
+ self,
370
+ types: Tuple[TypeStr, DecodesToIntTypeStr],
371
+ data: Decodable,
372
+ strict: bool = True,
373
+ ) -> Tuple[Any, int]:
374
+ ...
375
+
376
+ @overload
377
+ def decode(
378
+ self,
379
+ types: Tuple[TypeStr, BoolTypeStr],
380
+ data: Decodable,
381
+ strict: bool = True,
382
+ ) -> Tuple[Any, bool]:
383
+ ...
384
+
385
+ @overload
386
+ def decode(
387
+ self,
388
+ types: Tuple[TypeStr, TypeStr],
389
+ data: Decodable,
390
+ strict: bool = True,
391
+ ) -> Tuple[Any, Any]:
392
+ ...
393
+
394
+ # len == 3
395
+ # okay get ready for some ugly overloads
396
+ # We will probably not implement lengths > 3
397
+
398
+ @overload
399
+ def decode(
400
+ self,
401
+ types: Tuple[BytesTypeStr, BytesTypeStr, BytesTypeStr],
402
+ data: Decodable,
403
+ strict: bool = True,
404
+ ) -> Tuple[bytes, bytes, bytes]:
405
+ ...
406
+
407
+ @overload
408
+ def decode(
409
+ self,
410
+ types: Tuple[BytesTypeStr, BytesTypeStr, StringTypeStr],
411
+ data: Decodable,
412
+ strict: bool = True,
413
+ ) -> Tuple[bytes, bytes, str]:
414
+ ...
415
+
416
+ @overload
417
+ def decode(
418
+ self,
419
+ types: Tuple[BytesTypeStr, BytesTypeStr, DecodesToIntTypeStr],
420
+ data: Decodable,
421
+ strict: bool = True,
422
+ ) -> Tuple[bytes, bytes, int]:
423
+ ...
424
+
425
+ @overload
426
+ def decode(
427
+ self,
428
+ types: Tuple[BytesTypeStr, BytesTypeStr, BoolTypeStr],
429
+ data: Decodable,
430
+ strict: bool = True,
431
+ ) -> Tuple[bytes, bytes, bool]:
432
+ ...
433
+
434
+ @overload
435
+ def decode(
436
+ self,
437
+ types: Tuple[BytesTypeStr, BytesTypeStr, TypeStr],
438
+ data: Decodable,
439
+ strict: bool = True,
440
+ ) -> Tuple[bytes, bytes, Any]:
441
+ ...
442
+
443
+ @overload
444
+ def decode(
445
+ self,
446
+ types: Tuple[BytesTypeStr, StringTypeStr, BytesTypeStr],
447
+ data: Decodable,
448
+ strict: bool = True,
449
+ ) -> Tuple[bytes, str, bytes]:
450
+ ...
451
+
452
+ @overload
453
+ def decode(
454
+ self,
455
+ types: Tuple[BytesTypeStr, StringTypeStr, StringTypeStr],
456
+ data: Decodable,
457
+ strict: bool = True,
458
+ ) -> Tuple[bytes, str, str]:
459
+ ...
460
+
461
+ @overload
462
+ def decode(
463
+ self,
464
+ types: Tuple[BytesTypeStr, StringTypeStr, DecodesToIntTypeStr],
465
+ data: Decodable,
466
+ strict: bool = True,
467
+ ) -> Tuple[bytes, str, int]:
468
+ ...
469
+
470
+ @overload
471
+ def decode(
472
+ self,
473
+ types: Tuple[BytesTypeStr, StringTypeStr, BoolTypeStr],
474
+ data: Decodable,
475
+ strict: bool = True,
476
+ ) -> Tuple[bytes, str, bool]:
477
+ ...
478
+
479
+ @overload
480
+ def decode(
481
+ self,
482
+ types: Tuple[BytesTypeStr, StringTypeStr, TypeStr],
483
+ data: Decodable,
484
+ strict: bool = True,
485
+ ) -> Tuple[bytes, str, Any]:
486
+ ...
487
+
488
+ @overload
489
+ def decode(
490
+ self,
491
+ types: Tuple[BytesTypeStr, DecodesToIntTypeStr, BytesTypeStr],
492
+ data: Decodable,
493
+ strict: bool = True,
494
+ ) -> Tuple[bytes, int, bytes]:
495
+ ...
496
+
497
+ @overload
498
+ def decode(
499
+ self,
500
+ types: Tuple[BytesTypeStr, DecodesToIntTypeStr, StringTypeStr],
501
+ data: Decodable,
502
+ strict: bool = True,
503
+ ) -> Tuple[bytes, int, str]:
504
+ ...
505
+
506
+ @overload
507
+ def decode(
508
+ self,
509
+ types: Tuple[BytesTypeStr, DecodesToIntTypeStr, DecodesToIntTypeStr],
510
+ data: Decodable,
511
+ strict: bool = True,
512
+ ) -> Tuple[bytes, int, int]:
513
+ ...
514
+
515
+ @overload
516
+ def decode(
517
+ self,
518
+ types: Tuple[BytesTypeStr, DecodesToIntTypeStr, BoolTypeStr],
519
+ data: Decodable,
520
+ strict: bool = True,
521
+ ) -> Tuple[bytes, int, bool]:
522
+ ...
523
+
524
+ @overload
525
+ def decode(
526
+ self,
527
+ types: Tuple[BytesTypeStr, DecodesToIntTypeStr, TypeStr],
528
+ data: Decodable,
529
+ strict: bool = True,
530
+ ) -> Tuple[bytes, int, Any]:
531
+ ...
532
+
533
+ @overload
534
+ def decode(
535
+ self,
536
+ types: Tuple[BytesTypeStr, BoolTypeStr, BytesTypeStr],
537
+ data: Decodable,
538
+ strict: bool = True,
539
+ ) -> Tuple[bytes, bool, bytes]:
540
+ ...
541
+
542
+ @overload
543
+ def decode(
544
+ self,
545
+ types: Tuple[BytesTypeStr, BoolTypeStr, StringTypeStr],
546
+ data: Decodable,
547
+ strict: bool = True,
548
+ ) -> Tuple[bytes, bool, str]:
549
+ ...
550
+
551
+ @overload
552
+ def decode(
553
+ self,
554
+ types: Tuple[BytesTypeStr, BoolTypeStr, DecodesToIntTypeStr],
555
+ data: Decodable,
556
+ strict: bool = True,
557
+ ) -> Tuple[bytes, bool, int]:
558
+ ...
559
+
560
+ @overload
561
+ def decode(
562
+ self,
563
+ types: Tuple[BytesTypeStr, BoolTypeStr, BoolTypeStr],
564
+ data: Decodable,
565
+ strict: bool = True,
566
+ ) -> Tuple[bytes, bool, bool]:
567
+ ...
568
+
569
+ @overload
570
+ def decode(
571
+ self,
572
+ types: Tuple[BytesTypeStr, BoolTypeStr, TypeStr],
573
+ data: Decodable,
574
+ strict: bool = True,
575
+ ) -> Tuple[bytes, bool, Any]:
576
+ ...
577
+
578
+ @overload
579
+ def decode(
580
+ self,
581
+ types: Tuple[BytesTypeStr, TypeStr, BytesTypeStr],
582
+ data: Decodable,
583
+ strict: bool = True,
584
+ ) -> Tuple[bytes, Any, bytes]:
585
+ ...
586
+
587
+ @overload
588
+ def decode(
589
+ self,
590
+ types: Tuple[BytesTypeStr, TypeStr, StringTypeStr],
591
+ data: Decodable,
592
+ strict: bool = True,
593
+ ) -> Tuple[bytes, Any, str]:
594
+ ...
595
+
596
+ @overload
597
+ def decode(
598
+ self,
599
+ types: Tuple[BytesTypeStr, TypeStr, DecodesToIntTypeStr],
600
+ data: Decodable,
601
+ strict: bool = True,
602
+ ) -> Tuple[bytes, Any, int]:
603
+ ...
604
+
605
+ @overload
606
+ def decode(
607
+ self,
608
+ types: Tuple[BytesTypeStr, TypeStr, BoolTypeStr],
609
+ data: Decodable,
610
+ strict: bool = True,
611
+ ) -> Tuple[bytes, Any, bool]:
612
+ ...
613
+
614
+ @overload
615
+ def decode(
616
+ self,
617
+ types: Tuple[BytesTypeStr, TypeStr, TypeStr],
618
+ data: Decodable,
619
+ strict: bool = True,
620
+ ) -> Tuple[bytes, Any, Any]:
621
+ ...
622
+
623
+ @overload
624
+ def decode(
625
+ self,
626
+ types: Tuple[StringTypeStr, BytesTypeStr, BytesTypeStr],
627
+ data: Decodable,
628
+ strict: bool = True,
629
+ ) -> Tuple[str, bytes, bytes]:
630
+ ...
631
+
632
+ @overload
633
+ def decode(
634
+ self,
635
+ types: Tuple[StringTypeStr, BytesTypeStr, StringTypeStr],
636
+ data: Decodable,
637
+ strict: bool = True,
638
+ ) -> Tuple[str, bytes, str]:
639
+ ...
640
+
641
+ @overload
642
+ def decode(
643
+ self,
644
+ types: Tuple[StringTypeStr, BytesTypeStr, DecodesToIntTypeStr],
645
+ data: Decodable,
646
+ strict: bool = True,
647
+ ) -> Tuple[str, bytes, int]:
648
+ ...
649
+
650
+ @overload
651
+ def decode(
652
+ self,
653
+ types: Tuple[StringTypeStr, BytesTypeStr, BoolTypeStr],
654
+ data: Decodable,
655
+ strict: bool = True,
656
+ ) -> Tuple[str, bytes, bool]:
657
+ ...
658
+
659
+ @overload
660
+ def decode(
661
+ self,
662
+ types: Tuple[StringTypeStr, BytesTypeStr, TypeStr],
663
+ data: Decodable,
664
+ strict: bool = True,
665
+ ) -> Tuple[str, bytes, Any]:
666
+ ...
667
+
668
+ @overload
669
+ def decode(
670
+ self,
671
+ types: Tuple[StringTypeStr, StringTypeStr, BytesTypeStr],
672
+ data: Decodable,
673
+ strict: bool = True,
674
+ ) -> Tuple[str, str, bytes]:
675
+ ...
676
+
677
+ @overload
678
+ def decode(
679
+ self,
680
+ types: Tuple[StringTypeStr, StringTypeStr, StringTypeStr],
681
+ data: Decodable,
682
+ strict: bool = True,
683
+ ) -> Tuple[str, str, str]:
684
+ ...
685
+
686
+ @overload
687
+ def decode(
688
+ self,
689
+ types: Tuple[StringTypeStr, StringTypeStr, DecodesToIntTypeStr],
690
+ data: Decodable,
691
+ strict: bool = True,
692
+ ) -> Tuple[str, str, int]:
693
+ ...
694
+
695
+ @overload
696
+ def decode(
697
+ self,
698
+ types: Tuple[StringTypeStr, StringTypeStr, BoolTypeStr],
699
+ data: Decodable,
700
+ strict: bool = True,
701
+ ) -> Tuple[str, str, bool]:
702
+ ...
703
+
704
+ @overload
705
+ def decode(
706
+ self,
707
+ types: Tuple[StringTypeStr, StringTypeStr, TypeStr],
708
+ data: Decodable,
709
+ strict: bool = True,
710
+ ) -> Tuple[str, str, Any]:
711
+ ...
712
+
713
+ @overload
714
+ def decode(
715
+ self,
716
+ types: Tuple[StringTypeStr, DecodesToIntTypeStr, BytesTypeStr],
717
+ data: Decodable,
718
+ strict: bool = True,
719
+ ) -> Tuple[str, int, bytes]:
720
+ ...
721
+
722
+ @overload
723
+ def decode(
724
+ self,
725
+ types: Tuple[StringTypeStr, DecodesToIntTypeStr, StringTypeStr],
726
+ data: Decodable,
727
+ strict: bool = True,
728
+ ) -> Tuple[str, int, str]:
729
+ ...
730
+
731
+ @overload
732
+ def decode(
733
+ self,
734
+ types: Tuple[StringTypeStr, DecodesToIntTypeStr, DecodesToIntTypeStr],
735
+ data: Decodable,
736
+ strict: bool = True,
737
+ ) -> Tuple[str, int, int]:
738
+ ...
739
+
740
+ @overload
741
+ def decode(
742
+ self,
743
+ types: Tuple[StringTypeStr, DecodesToIntTypeStr, BoolTypeStr],
744
+ data: Decodable,
745
+ strict: bool = True,
746
+ ) -> Tuple[str, int, bool]:
747
+ ...
748
+
749
+ @overload
750
+ def decode(
751
+ self,
752
+ types: Tuple[StringTypeStr, DecodesToIntTypeStr, TypeStr],
753
+ data: Decodable,
754
+ strict: bool = True,
755
+ ) -> Tuple[str, int, Any]:
756
+ ...
757
+
758
+ @overload
759
+ def decode(
760
+ self,
761
+ types: Tuple[StringTypeStr, BoolTypeStr, BytesTypeStr],
762
+ data: Decodable,
763
+ strict: bool = True,
764
+ ) -> Tuple[str, bool, bytes]:
765
+ ...
766
+
767
+ @overload
768
+ def decode(
769
+ self,
770
+ types: Tuple[StringTypeStr, BoolTypeStr, StringTypeStr],
771
+ data: Decodable,
772
+ strict: bool = True,
773
+ ) -> Tuple[str, bool, str]:
774
+ ...
775
+
776
+ @overload
777
+ def decode(
778
+ self,
779
+ types: Tuple[StringTypeStr, BoolTypeStr, DecodesToIntTypeStr],
780
+ data: Decodable,
781
+ strict: bool = True,
782
+ ) -> Tuple[str, bool, int]:
783
+ ...
784
+
785
+ @overload
786
+ def decode(
787
+ self,
788
+ types: Tuple[StringTypeStr, BoolTypeStr, BoolTypeStr],
789
+ data: Decodable,
790
+ strict: bool = True,
791
+ ) -> Tuple[str, bool, bool]:
792
+ ...
793
+
794
+ @overload
795
+ def decode(
796
+ self,
797
+ types: Tuple[StringTypeStr, BoolTypeStr, TypeStr],
798
+ data: Decodable,
799
+ strict: bool = True,
800
+ ) -> Tuple[str, bool, Any]:
801
+ ...
802
+
803
+ @overload
804
+ def decode(
805
+ self,
806
+ types: Tuple[StringTypeStr, TypeStr, BytesTypeStr],
807
+ data: Decodable,
808
+ strict: bool = True,
809
+ ) -> Tuple[str, Any, bytes]:
810
+ ...
811
+
812
+ @overload
813
+ def decode(
814
+ self,
815
+ types: Tuple[StringTypeStr, TypeStr, StringTypeStr],
816
+ data: Decodable,
817
+ strict: bool = True,
818
+ ) -> Tuple[str, Any, str]:
819
+ ...
820
+
821
+ @overload
822
+ def decode(
823
+ self,
824
+ types: Tuple[StringTypeStr, TypeStr, DecodesToIntTypeStr],
825
+ data: Decodable,
826
+ strict: bool = True,
827
+ ) -> Tuple[str, Any, int]:
828
+ ...
829
+
830
+ @overload
831
+ def decode(
832
+ self,
833
+ types: Tuple[StringTypeStr, TypeStr, BoolTypeStr],
834
+ data: Decodable,
835
+ strict: bool = True,
836
+ ) -> Tuple[str, Any, bool]:
837
+ ...
838
+
839
+ @overload
840
+ def decode(
841
+ self,
842
+ types: Tuple[StringTypeStr, TypeStr, TypeStr],
843
+ data: Decodable,
844
+ strict: bool = True,
845
+ ) -> Tuple[str, Any, Any]:
846
+ ...
847
+
848
+ @overload
849
+ def decode(
850
+ self,
851
+ types: Tuple[DecodesToIntTypeStr, BytesTypeStr, BytesTypeStr],
852
+ data: Decodable,
853
+ strict: bool = True,
854
+ ) -> Tuple[int, bytes, bytes]:
855
+ ...
856
+
857
+ @overload
858
+ def decode(
859
+ self,
860
+ types: Tuple[DecodesToIntTypeStr, BytesTypeStr, StringTypeStr],
861
+ data: Decodable,
862
+ strict: bool = True,
863
+ ) -> Tuple[int, bytes, str]:
864
+ ...
865
+
866
+ @overload
867
+ def decode(
868
+ self,
869
+ types: Tuple[DecodesToIntTypeStr, BytesTypeStr, DecodesToIntTypeStr],
870
+ data: Decodable,
871
+ strict: bool = True,
872
+ ) -> Tuple[int, bytes, int]:
873
+ ...
874
+
875
+ @overload
876
+ def decode(
877
+ self,
878
+ types: Tuple[DecodesToIntTypeStr, BytesTypeStr, BoolTypeStr],
879
+ data: Decodable,
880
+ strict: bool = True,
881
+ ) -> Tuple[int, bytes, bool]:
882
+ ...
883
+
884
+ @overload
885
+ def decode(
886
+ self,
887
+ types: Tuple[DecodesToIntTypeStr, BytesTypeStr, TypeStr],
888
+ data: Decodable,
889
+ strict: bool = True,
890
+ ) -> Tuple[int, bytes, Any]:
891
+ ...
892
+
893
+ @overload
894
+ def decode(
895
+ self,
896
+ types: Tuple[DecodesToIntTypeStr, StringTypeStr, BytesTypeStr],
897
+ data: Decodable,
898
+ strict: bool = True,
899
+ ) -> Tuple[int, str, bytes]:
900
+ ...
901
+
902
+ @overload
903
+ def decode(
904
+ self,
905
+ types: Tuple[DecodesToIntTypeStr, StringTypeStr, StringTypeStr],
906
+ data: Decodable,
907
+ strict: bool = True,
908
+ ) -> Tuple[int, str, str]:
909
+ ...
910
+
911
+ @overload
912
+ def decode(
913
+ self,
914
+ types: Tuple[DecodesToIntTypeStr, StringTypeStr, DecodesToIntTypeStr],
915
+ data: Decodable,
916
+ strict: bool = True,
917
+ ) -> Tuple[int, str, int]:
918
+ ...
919
+
920
+ @overload
921
+ def decode(
922
+ self,
923
+ types: Tuple[DecodesToIntTypeStr, StringTypeStr, BoolTypeStr],
924
+ data: Decodable,
925
+ strict: bool = True,
926
+ ) -> Tuple[int, str, bool]:
927
+ ...
928
+
929
+ @overload
930
+ def decode(
931
+ self,
932
+ types: Tuple[DecodesToIntTypeStr, StringTypeStr, TypeStr],
933
+ data: Decodable,
934
+ strict: bool = True,
935
+ ) -> Tuple[int, str, Any]:
936
+ ...
937
+
938
+ @overload
939
+ def decode(
940
+ self,
941
+ types: Tuple[DecodesToIntTypeStr, DecodesToIntTypeStr, BytesTypeStr],
942
+ data: Decodable,
943
+ strict: bool = True,
944
+ ) -> Tuple[int, int, bytes]:
945
+ ...
946
+
947
+ @overload
948
+ def decode(
949
+ self,
950
+ types: Tuple[DecodesToIntTypeStr, DecodesToIntTypeStr, StringTypeStr],
951
+ data: Decodable,
952
+ strict: bool = True,
953
+ ) -> Tuple[int, int, str]:
954
+ ...
955
+
956
+ @overload
957
+ def decode(
958
+ self,
959
+ types: Tuple[DecodesToIntTypeStr, DecodesToIntTypeStr, DecodesToIntTypeStr],
960
+ data: Decodable,
961
+ strict: bool = True,
962
+ ) -> Tuple[int, int, int]:
963
+ ...
964
+
965
+ @overload
966
+ def decode(
967
+ self,
968
+ types: Tuple[DecodesToIntTypeStr, DecodesToIntTypeStr, BoolTypeStr],
969
+ data: Decodable,
970
+ strict: bool = True,
971
+ ) -> Tuple[int, int, bool]:
972
+ ...
973
+
974
+ @overload
975
+ def decode(
976
+ self,
977
+ types: Tuple[DecodesToIntTypeStr, DecodesToIntTypeStr, TypeStr],
978
+ data: Decodable,
979
+ strict: bool = True,
980
+ ) -> Tuple[int, int, Any]:
981
+ ...
982
+
983
+ @overload
984
+ def decode(
985
+ self,
986
+ types: Tuple[DecodesToIntTypeStr, BoolTypeStr, BytesTypeStr],
987
+ data: Decodable,
988
+ strict: bool = True,
989
+ ) -> Tuple[int, bool, bytes]:
990
+ ...
991
+
992
+ @overload
993
+ def decode(
994
+ self,
995
+ types: Tuple[DecodesToIntTypeStr, BoolTypeStr, StringTypeStr],
996
+ data: Decodable,
997
+ strict: bool = True,
998
+ ) -> Tuple[int, bool, str]:
999
+ ...
1000
+
1001
+ @overload
1002
+ def decode(
1003
+ self,
1004
+ types: Tuple[DecodesToIntTypeStr, BoolTypeStr, DecodesToIntTypeStr],
1005
+ data: Decodable,
1006
+ strict: bool = True,
1007
+ ) -> Tuple[int, bool, int]:
1008
+ ...
1009
+
1010
+ @overload
1011
+ def decode(
1012
+ self,
1013
+ types: Tuple[DecodesToIntTypeStr, BoolTypeStr, BoolTypeStr],
1014
+ data: Decodable,
1015
+ strict: bool = True,
1016
+ ) -> Tuple[int, bool, bool]:
1017
+ ...
1018
+
1019
+ @overload
1020
+ def decode(
1021
+ self,
1022
+ types: Tuple[DecodesToIntTypeStr, BoolTypeStr, TypeStr],
1023
+ data: Decodable,
1024
+ strict: bool = True,
1025
+ ) -> Tuple[int, bool, Any]:
1026
+ ...
1027
+
1028
+ @overload
1029
+ def decode(
1030
+ self,
1031
+ types: Tuple[DecodesToIntTypeStr, TypeStr, BytesTypeStr],
1032
+ data: Decodable,
1033
+ strict: bool = True,
1034
+ ) -> Tuple[int, Any, bytes]:
1035
+ ...
1036
+
1037
+ @overload
1038
+ def decode(
1039
+ self,
1040
+ types: Tuple[DecodesToIntTypeStr, TypeStr, StringTypeStr],
1041
+ data: Decodable,
1042
+ strict: bool = True,
1043
+ ) -> Tuple[int, Any, str]:
1044
+ ...
1045
+
1046
+ @overload
1047
+ def decode(
1048
+ self,
1049
+ types: Tuple[DecodesToIntTypeStr, TypeStr, DecodesToIntTypeStr],
1050
+ data: Decodable,
1051
+ strict: bool = True,
1052
+ ) -> Tuple[int, Any, int]:
1053
+ ...
1054
+
1055
+ @overload
1056
+ def decode(
1057
+ self,
1058
+ types: Tuple[DecodesToIntTypeStr, TypeStr, BoolTypeStr],
1059
+ data: Decodable,
1060
+ strict: bool = True,
1061
+ ) -> Tuple[int, Any, bool]:
1062
+ ...
1063
+
1064
+ @overload
1065
+ def decode(
1066
+ self,
1067
+ types: Tuple[DecodesToIntTypeStr, TypeStr, TypeStr],
1068
+ data: Decodable,
1069
+ strict: bool = True,
1070
+ ) -> Tuple[int, Any, Any]:
1071
+ ...
1072
+
1073
+ @overload
1074
+ def decode(
1075
+ self,
1076
+ types: Tuple[BoolTypeStr, BytesTypeStr, BytesTypeStr],
1077
+ data: Decodable,
1078
+ strict: bool = True,
1079
+ ) -> Tuple[bool, bytes, bytes]:
1080
+ ...
1081
+
1082
+ @overload
1083
+ def decode(
1084
+ self,
1085
+ types: Tuple[BoolTypeStr, BytesTypeStr, StringTypeStr],
1086
+ data: Decodable,
1087
+ strict: bool = True,
1088
+ ) -> Tuple[bool, bytes, str]:
1089
+ ...
1090
+
1091
+ @overload
1092
+ def decode(
1093
+ self,
1094
+ types: Tuple[BoolTypeStr, BytesTypeStr, DecodesToIntTypeStr],
1095
+ data: Decodable,
1096
+ strict: bool = True,
1097
+ ) -> Tuple[bool, bytes, int]:
1098
+ ...
1099
+
1100
+ @overload
1101
+ def decode(
1102
+ self,
1103
+ types: Tuple[BoolTypeStr, BytesTypeStr, BoolTypeStr],
1104
+ data: Decodable,
1105
+ strict: bool = True,
1106
+ ) -> Tuple[bool, bytes, bool]:
1107
+ ...
1108
+
1109
+ @overload
1110
+ def decode(
1111
+ self,
1112
+ types: Tuple[BoolTypeStr, BytesTypeStr, TypeStr],
1113
+ data: Decodable,
1114
+ strict: bool = True,
1115
+ ) -> Tuple[bool, bytes, Any]:
1116
+ ...
1117
+
1118
+ @overload
1119
+ def decode(
1120
+ self,
1121
+ types: Tuple[BoolTypeStr, StringTypeStr, BytesTypeStr],
1122
+ data: Decodable,
1123
+ strict: bool = True,
1124
+ ) -> Tuple[bool, str, bytes]:
1125
+ ...
1126
+
1127
+ @overload
1128
+ def decode(
1129
+ self,
1130
+ types: Tuple[BoolTypeStr, StringTypeStr, StringTypeStr],
1131
+ data: Decodable,
1132
+ strict: bool = True,
1133
+ ) -> Tuple[bool, str, str]:
1134
+ ...
1135
+
1136
+ @overload
1137
+ def decode(
1138
+ self,
1139
+ types: Tuple[BoolTypeStr, StringTypeStr, DecodesToIntTypeStr],
1140
+ data: Decodable,
1141
+ strict: bool = True,
1142
+ ) -> Tuple[bool, str, int]:
1143
+ ...
1144
+
1145
+ @overload
1146
+ def decode(
1147
+ self,
1148
+ types: Tuple[BoolTypeStr, StringTypeStr, BoolTypeStr],
1149
+ data: Decodable,
1150
+ strict: bool = True,
1151
+ ) -> Tuple[bool, str, bool]:
1152
+ ...
1153
+
1154
+ @overload
1155
+ def decode(
1156
+ self,
1157
+ types: Tuple[BoolTypeStr, StringTypeStr, TypeStr],
1158
+ data: Decodable,
1159
+ strict: bool = True,
1160
+ ) -> Tuple[bool, str, Any]:
1161
+ ...
1162
+
1163
+ @overload
1164
+ def decode(
1165
+ self,
1166
+ types: Tuple[BoolTypeStr, DecodesToIntTypeStr, BytesTypeStr],
1167
+ data: Decodable,
1168
+ strict: bool = True,
1169
+ ) -> Tuple[bool, int, bytes]:
1170
+ ...
1171
+
1172
+ @overload
1173
+ def decode(
1174
+ self,
1175
+ types: Tuple[BoolTypeStr, DecodesToIntTypeStr, StringTypeStr],
1176
+ data: Decodable,
1177
+ strict: bool = True,
1178
+ ) -> Tuple[bool, int, str]:
1179
+ ...
1180
+
1181
+ @overload
1182
+ def decode(
1183
+ self,
1184
+ types: Tuple[BoolTypeStr, DecodesToIntTypeStr, DecodesToIntTypeStr],
1185
+ data: Decodable,
1186
+ strict: bool = True,
1187
+ ) -> Tuple[bool, int, int]:
1188
+ ...
1189
+
1190
+ @overload
1191
+ def decode(
1192
+ self,
1193
+ types: Tuple[BoolTypeStr, DecodesToIntTypeStr, BoolTypeStr],
1194
+ data: Decodable,
1195
+ strict: bool = True,
1196
+ ) -> Tuple[bool, int, bool]:
1197
+ ...
1198
+
1199
+ @overload
1200
+ def decode(
1201
+ self,
1202
+ types: Tuple[BoolTypeStr, DecodesToIntTypeStr, TypeStr],
1203
+ data: Decodable,
1204
+ strict: bool = True,
1205
+ ) -> Tuple[bool, int, Any]:
1206
+ ...
1207
+
1208
+ @overload
1209
+ def decode(
1210
+ self,
1211
+ types: Tuple[BoolTypeStr, BoolTypeStr, BytesTypeStr],
1212
+ data: Decodable,
1213
+ strict: bool = True,
1214
+ ) -> Tuple[bool, bool, bytes]:
1215
+ ...
1216
+
1217
+ @overload
1218
+ def decode(
1219
+ self,
1220
+ types: Tuple[BoolTypeStr, BoolTypeStr, StringTypeStr],
1221
+ data: Decodable,
1222
+ strict: bool = True,
1223
+ ) -> Tuple[bool, bool, str]:
1224
+ ...
1225
+
1226
+ @overload
1227
+ def decode(
1228
+ self,
1229
+ types: Tuple[BoolTypeStr, BoolTypeStr, DecodesToIntTypeStr],
1230
+ data: Decodable,
1231
+ strict: bool = True,
1232
+ ) -> Tuple[bool, bool, int]:
1233
+ ...
1234
+
1235
+ @overload
1236
+ def decode(
1237
+ self,
1238
+ types: Tuple[BoolTypeStr, BoolTypeStr, BoolTypeStr],
1239
+ data: Decodable,
1240
+ strict: bool = True,
1241
+ ) -> Tuple[bool, bool, bool]:
1242
+ ...
1243
+
1244
+ @overload
1245
+ def decode(
1246
+ self,
1247
+ types: Tuple[BoolTypeStr, BoolTypeStr, TypeStr],
1248
+ data: Decodable,
1249
+ strict: bool = True,
1250
+ ) -> Tuple[bool, bool, Any]:
1251
+ ...
1252
+
1253
+ @overload
1254
+ def decode(
1255
+ self,
1256
+ types: Tuple[BoolTypeStr, TypeStr, BytesTypeStr],
1257
+ data: Decodable,
1258
+ strict: bool = True,
1259
+ ) -> Tuple[bool, Any, bytes]:
1260
+ ...
1261
+
1262
+ @overload
1263
+ def decode(
1264
+ self,
1265
+ types: Tuple[BoolTypeStr, TypeStr, StringTypeStr],
1266
+ data: Decodable,
1267
+ strict: bool = True,
1268
+ ) -> Tuple[bool, Any, str]:
1269
+ ...
1270
+
1271
+ @overload
1272
+ def decode(
1273
+ self,
1274
+ types: Tuple[BoolTypeStr, TypeStr, DecodesToIntTypeStr],
1275
+ data: Decodable,
1276
+ strict: bool = True,
1277
+ ) -> Tuple[bool, Any, int]:
1278
+ ...
1279
+
1280
+ @overload
1281
+ def decode(
1282
+ self,
1283
+ types: Tuple[BoolTypeStr, TypeStr, BoolTypeStr],
1284
+ data: Decodable,
1285
+ strict: bool = True,
1286
+ ) -> Tuple[bool, Any, bool]:
1287
+ ...
1288
+
1289
+ @overload
1290
+ def decode(
1291
+ self,
1292
+ types: Tuple[BoolTypeStr, TypeStr, TypeStr],
1293
+ data: Decodable,
1294
+ strict: bool = True,
1295
+ ) -> Tuple[bool, Any, Any]:
1296
+ ...
1297
+
1298
+ # --- Fallbacks for len == 3 ---
1299
+
1300
+ @overload
1301
+ def decode(
1302
+ self,
1303
+ types: Tuple[TypeStr, BytesTypeStr, BytesTypeStr],
1304
+ data: Decodable,
1305
+ strict: bool = True,
1306
+ ) -> Tuple[Any, bytes, bytes]:
1307
+ ...
1308
+
1309
+ @overload
1310
+ def decode(
1311
+ self,
1312
+ types: Tuple[TypeStr, BytesTypeStr, StringTypeStr],
1313
+ data: Decodable,
1314
+ strict: bool = True,
1315
+ ) -> Tuple[Any, bytes, str]:
1316
+ ...
1317
+
1318
+ @overload
1319
+ def decode(
1320
+ self,
1321
+ types: Tuple[TypeStr, BytesTypeStr, DecodesToIntTypeStr],
1322
+ data: Decodable,
1323
+ strict: bool = True,
1324
+ ) -> Tuple[Any, bytes, int]:
1325
+ ...
1326
+
1327
+ @overload
1328
+ def decode(
1329
+ self,
1330
+ types: Tuple[TypeStr, BytesTypeStr, BoolTypeStr],
1331
+ data: Decodable,
1332
+ strict: bool = True,
1333
+ ) -> Tuple[Any, bytes, bool]:
1334
+ ...
1335
+
1336
+ @overload
1337
+ def decode(
1338
+ self,
1339
+ types: Tuple[TypeStr, BytesTypeStr, TypeStr],
1340
+ data: Decodable,
1341
+ strict: bool = True,
1342
+ ) -> Tuple[Any, bytes, Any]:
1343
+ ...
1344
+
1345
+ @overload
1346
+ def decode(
1347
+ self,
1348
+ types: Tuple[TypeStr, StringTypeStr, BytesTypeStr],
1349
+ data: Decodable,
1350
+ strict: bool = True,
1351
+ ) -> Tuple[Any, str, bytes]:
1352
+ ...
1353
+
1354
+ @overload
1355
+ def decode(
1356
+ self,
1357
+ types: Tuple[TypeStr, StringTypeStr, StringTypeStr],
1358
+ data: Decodable,
1359
+ strict: bool = True,
1360
+ ) -> Tuple[Any, str, str]:
1361
+ ...
1362
+
1363
+ @overload
1364
+ def decode(
1365
+ self,
1366
+ types: Tuple[TypeStr, StringTypeStr, DecodesToIntTypeStr],
1367
+ data: Decodable,
1368
+ strict: bool = True,
1369
+ ) -> Tuple[Any, str, int]:
1370
+ ...
1371
+
1372
+ @overload
1373
+ def decode(
1374
+ self,
1375
+ types: Tuple[TypeStr, StringTypeStr, BoolTypeStr],
1376
+ data: Decodable,
1377
+ strict: bool = True,
1378
+ ) -> Tuple[Any, str, bool]:
1379
+ ...
1380
+
1381
+ @overload
1382
+ def decode(
1383
+ self,
1384
+ types: Tuple[TypeStr, StringTypeStr, TypeStr],
1385
+ data: Decodable,
1386
+ strict: bool = True,
1387
+ ) -> Tuple[Any, str, Any]:
1388
+ ...
1389
+
1390
+ @overload
1391
+ def decode(
1392
+ self,
1393
+ types: Tuple[TypeStr, DecodesToIntTypeStr, BytesTypeStr],
1394
+ data: Decodable,
1395
+ strict: bool = True,
1396
+ ) -> Tuple[Any, int, bytes]:
1397
+ ...
1398
+
1399
+ @overload
1400
+ def decode(
1401
+ self,
1402
+ types: Tuple[TypeStr, DecodesToIntTypeStr, StringTypeStr],
1403
+ data: Decodable,
1404
+ strict: bool = True,
1405
+ ) -> Tuple[Any, int, str]:
1406
+ ...
1407
+
1408
+ @overload
1409
+ def decode(
1410
+ self,
1411
+ types: Tuple[TypeStr, DecodesToIntTypeStr, DecodesToIntTypeStr],
1412
+ data: Decodable,
1413
+ strict: bool = True,
1414
+ ) -> Tuple[Any, int, int]:
1415
+ ...
1416
+
1417
+ @overload
1418
+ def decode(
1419
+ self,
1420
+ types: Tuple[TypeStr, DecodesToIntTypeStr, BoolTypeStr],
1421
+ data: Decodable,
1422
+ strict: bool = True,
1423
+ ) -> Tuple[Any, int, bool]:
1424
+ ...
1425
+
1426
+ @overload
1427
+ def decode(
1428
+ self,
1429
+ types: Tuple[TypeStr, DecodesToIntTypeStr, TypeStr],
1430
+ data: Decodable,
1431
+ strict: bool = True,
1432
+ ) -> Tuple[Any, int, Any]:
1433
+ ...
1434
+
1435
+ @overload
1436
+ def decode(
1437
+ self,
1438
+ types: Tuple[TypeStr, BoolTypeStr, BytesTypeStr],
1439
+ data: Decodable,
1440
+ strict: bool = True,
1441
+ ) -> Tuple[Any, bool, bytes]:
1442
+ ...
1443
+
1444
+ @overload
1445
+ def decode(
1446
+ self,
1447
+ types: Tuple[TypeStr, BoolTypeStr, StringTypeStr],
1448
+ data: Decodable,
1449
+ strict: bool = True,
1450
+ ) -> Tuple[Any, bool, str]:
1451
+ ...
1452
+
1453
+ @overload
1454
+ def decode(
1455
+ self,
1456
+ types: Tuple[TypeStr, BoolTypeStr, DecodesToIntTypeStr],
1457
+ data: Decodable,
1458
+ strict: bool = True,
1459
+ ) -> Tuple[Any, bool, int]:
1460
+ ...
1461
+
1462
+ @overload
1463
+ def decode(
1464
+ self,
1465
+ types: Tuple[TypeStr, BoolTypeStr, BoolTypeStr],
1466
+ data: Decodable,
1467
+ strict: bool = True,
1468
+ ) -> Tuple[Any, bool, bool]:
1469
+ ...
1470
+
1471
+ @overload
1472
+ def decode(
1473
+ self,
1474
+ types: Tuple[TypeStr, BoolTypeStr, TypeStr],
1475
+ data: Decodable,
1476
+ strict: bool = True,
1477
+ ) -> Tuple[Any, bool, Any]:
1478
+ ...
1479
+
1480
+ @overload
1481
+ def decode(
1482
+ self,
1483
+ types: Tuple[TypeStr, TypeStr, BytesTypeStr],
1484
+ data: Decodable,
1485
+ strict: bool = True,
1486
+ ) -> Tuple[Any, Any, bytes]:
1487
+ ...
1488
+
1489
+ @overload
1490
+ def decode(
1491
+ self,
1492
+ types: Tuple[TypeStr, TypeStr, StringTypeStr],
1493
+ data: Decodable,
1494
+ strict: bool = True,
1495
+ ) -> Tuple[Any, Any, str]:
1496
+ ...
1497
+
1498
+ @overload
1499
+ def decode(
1500
+ self,
1501
+ types: Tuple[TypeStr, TypeStr, DecodesToIntTypeStr],
1502
+ data: Decodable,
1503
+ strict: bool = True,
1504
+ ) -> Tuple[Any, Any, int]:
1505
+ ...
1506
+
1507
+ @overload
1508
+ def decode(
1509
+ self,
1510
+ types: Tuple[TypeStr, TypeStr, BoolTypeStr],
1511
+ data: Decodable,
1512
+ strict: bool = True,
1513
+ ) -> Tuple[Any, Any, bool]:
1514
+ ...
1515
+
1516
+ @overload
1517
+ def decode(
1518
+ self,
1519
+ types: Tuple[TypeStr, TypeStr, TypeStr],
1520
+ data: Decodable,
1521
+ strict: bool = True,
1522
+ ) -> Tuple[Any, Any, Any]:
1523
+ ...
1524
+
1525
+ # non-tuple types input
1526
+
1527
+ @overload
1528
+ def decode(
1529
+ self,
1530
+ types: Iterable[BytesTypeStr],
1531
+ data: Decodable,
1532
+ strict: bool = True,
1533
+ ) -> Tuple[bytes, ...]:
1534
+ ...
1535
+
1536
+ @overload
1537
+ def decode(
1538
+ self,
1539
+ types: Iterable[StringTypeStr],
1540
+ data: Decodable,
1541
+ strict: bool = True,
1542
+ ) -> Tuple[str, ...]:
1543
+ ...
1544
+
1545
+ @overload
1546
+ def decode(
1547
+ self,
1548
+ types: Iterable[DecodesToIntTypeStr],
1549
+ data: Decodable,
1550
+ strict: bool = True,
1551
+ ) -> Tuple[int, ...]:
1552
+ ...
1553
+
1554
+ @overload
1555
+ def decode(
1556
+ self,
1557
+ types: Iterable[BoolTypeStr],
1558
+ data: Decodable,
1559
+ strict: bool = True,
1560
+ ) -> Tuple[bool, ...]:
1561
+ ...
1562
+
1563
+ # fallback to union types, still better than Any
1564
+ @overload
1565
+ def decode(
1566
+ self,
1567
+ types: Iterable[Union[BytesTypeStr, StringTypeStr]],
1568
+ data: Decodable,
1569
+ strict: bool = True,
1570
+ ) -> Tuple[Union[bytes, str], ...]:
1571
+ ...
1572
+
1573
+ @overload
1574
+ def decode(
1575
+ self,
1576
+ types: Iterable[Union[BytesTypeStr, DecodesToIntTypeStr]],
1577
+ data: Decodable,
1578
+ strict: bool = True,
1579
+ ) -> Tuple[Union[bytes, int], ...]:
1580
+ ...
1581
+
1582
+ @overload
1583
+ def decode(
1584
+ self,
1585
+ types: Iterable[Union[BytesTypeStr, BoolTypeStr]],
1586
+ data: Decodable,
1587
+ strict: bool = True,
1588
+ ) -> Tuple[Union[bytes, bool], ...]:
1589
+ ...
1590
+
1591
+ @overload
1592
+ def decode(
1593
+ self,
1594
+ types: Iterable[Union[StringTypeStr, DecodesToIntTypeStr]],
1595
+ data: Decodable,
1596
+ strict: bool = True,
1597
+ ) -> Tuple[Union[str, int], ...]:
1598
+ ...
1599
+
1600
+ @overload
1601
+ def decode(
1602
+ self,
1603
+ types: Iterable[Union[StringTypeStr, BoolTypeStr]],
1604
+ data: Decodable,
1605
+ strict: bool = True,
1606
+ ) -> Tuple[Union[str, bool], ...]:
1607
+ ...
1608
+
1609
+ @overload
1610
+ def decode(
1611
+ self,
1612
+ types: Iterable[Union[DecodesToIntTypeStr, BoolTypeStr]],
1613
+ data: Decodable,
1614
+ strict: bool = True,
1615
+ ) -> Tuple[Union[int, bool], ...]:
1616
+ ...
1617
+
1618
+ @overload
1619
+ def decode(
1620
+ self,
1621
+ types: Iterable[Union[BytesTypeStr, StringTypeStr, DecodesToIntTypeStr]],
1622
+ data: Decodable,
1623
+ strict: bool = True,
1624
+ ) -> Tuple[Union[bytes, str, int], ...]:
1625
+ ...
1626
+
1627
+ @overload
1628
+ def decode(
1629
+ self,
1630
+ types: Iterable[Union[BytesTypeStr, StringTypeStr, BoolTypeStr]],
1631
+ data: Decodable,
1632
+ strict: bool = True,
1633
+ ) -> Tuple[Union[bytes, str, bool], ...]:
1634
+ ...
1635
+
1636
+ @overload
1637
+ def decode(
1638
+ self,
1639
+ types: Iterable[Union[BytesTypeStr, DecodesToIntTypeStr, BoolTypeStr]],
1640
+ data: Decodable,
1641
+ strict: bool = True,
1642
+ ) -> Tuple[Union[bytes, int, bool], ...]:
1643
+ ...
1644
+
1645
+ @overload
1646
+ def decode(
1647
+ self,
1648
+ types: Iterable[Union[StringTypeStr, DecodesToIntTypeStr, BoolTypeStr]],
1649
+ data: Decodable,
1650
+ strict: bool = True,
1651
+ ) -> Tuple[Union[str, int, bool], ...]:
1652
+ ...
1653
+
1654
+ @overload
1655
+ def decode(
1656
+ self,
1657
+ types: Iterable[
1658
+ Union[BytesTypeStr, StringTypeStr, DecodesToIntTypeStr, BoolTypeStr]
1659
+ ],
1660
+ data: Decodable,
1661
+ strict: bool = True,
1662
+ ) -> Tuple[Union[bytes, str, int, bool], ...]:
1663
+ ...
1664
+
115
1665
  def decode(
116
1666
  self,
117
1667
  types: Iterable[TypeStr],