添加链接
注册
登录
link管理
链接快照平台
输入网页链接,自动生成快照
标签化管理网页链接
相关文章推荐
八块腹肌的生菜
·
黑枸杞子树苗-黑枸杞子树苗促销价格、黑枸杞子 ...
·
2 天前
·
眼睛小的盒饭
·
金监总局:严禁财产保险公司将线下业务通过互联 ...
·
2 月前
·
含蓄的显示器
·
王者荣耀杨玉环新皮肤上线日期确定,与周瑜联动 ...
·
3 月前
·
另类的牙膏
·
鸣人的假期无白屏版-鸣人的假期无白屏版无广告 ...
·
3 月前
·
踢足球的南瓜
·
《全球能源互联网》期刊(官网)
·
7 月前
·
link管理
›
typeshed/stdlib/builtins.pyi at main · python/typeshed · GitHub
sub
info
cls
overload
https://github.com/python/typeshed/blob/main/stdlib/builtins.pyi
听话的伤痕
3 月前
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Files
main
Breadcrumbs
typeshed
/
stdlib
/
builtins.pyi
Blame
Blame
Latest commit
History
History
2103 lines (1972 loc) · 85.6 KB
main
Breadcrumbs
typeshed
/
stdlib
/
builtins.pyi
Top
File metadata and controls
Code
Blame
2103 lines (1972 loc) · 85.6 KB
Raw
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
991
992
993
994
995
996
997
998
999
1000
# ruff: noqa: PYI036 # This is the module declaring BaseException
import
_ast
import
_typeshed
import
sys
import
types
from
_collections_abc
import
dict_items
,
dict_keys
,
dict_values
from
_typeshed
import
(
AnyStr_co
,
ConvertibleToFloat
,
ConvertibleToInt
,
FileDescriptorOrPath
,
OpenBinaryMode
,
OpenBinaryModeReading
,
OpenBinaryModeUpdating
,
OpenBinaryModeWriting
,
OpenTextMode
,
ReadableBuffer
,
SupportsAdd
,
SupportsAiter
,
SupportsAnext
,
SupportsDivMod
,
SupportsFlush
,
SupportsIter
,
SupportsKeysAndGetItem
,
SupportsLenAndGetItem
,
SupportsNext
,
SupportsRAdd
,
SupportsRDivMod
,
SupportsRichComparison
,
SupportsRichComparisonT
,
SupportsWrite
,
)
from
collections
.
abc
import
Awaitable
,
Callable
,
Iterable
,
Iterator
,
MutableSet
,
Reversible
,
Set
as
AbstractSet
,
Sized
from
io
import
BufferedRandom
,
BufferedReader
,
BufferedWriter
,
FileIO
,
TextIOWrapper
from
types
import
CellType
,
CodeType
,
TracebackType
# mypy crashes if any of {ByteString, Sequence, MutableSequence, Mapping, MutableMapping}
# are imported from collections.abc in builtins.pyi
from
typing
import
(
# noqa: Y022
IO
,
Any
,
BinaryIO
,
ClassVar
,
Generic
,
Mapping
,
MutableMapping
,
MutableSequence
,
NoReturn
,
Protocol
,
Sequence
,
SupportsAbs
,
SupportsBytes
,
SupportsComplex
,
SupportsFloat
,
SupportsIndex
,
TypeVar
,
final
,
overload
,
type_check_only
,
)
# we can't import `Literal` from typing or mypy crashes: see #11247
from
typing_extensions
import
(
# noqa: Y023
Concatenate
,
Literal
,
LiteralString
,
ParamSpec
,
Self
,
TypeAlias
,
TypeGuard
,
TypeIs
,
TypeVarTuple
,
deprecated
,
)
if
sys
.
version_info
>=
(
3
,
9
):
from
types
import
GenericAlias
_T
=
TypeVar
(
"_T"
)
_I
=
TypeVar
(
"_I"
,
default
=
int
)
_T_co
=
TypeVar
(
"_T_co"
,
covariant
=
True
)
_T_contra
=
TypeVar
(
"_T_contra"
,
contravariant
=
True
)
_R_co
=
TypeVar
(
"_R_co"
,
covariant
=
True
)
_KT
=
TypeVar
(
"_KT"
)
_VT
=
TypeVar
(
"_VT"
)
_S
=
TypeVar
(
"_S"
)
_T1
=
TypeVar
(
"_T1"
)
_T2
=
TypeVar
(
"_T2"
)
_T3
=
TypeVar
(
"_T3"
)
_T4
=
TypeVar
(
"_T4"
)
_T5
=
TypeVar
(
"_T5"
)
_SupportsNextT
=
TypeVar
(
"_SupportsNextT"
,
bound
=
SupportsNext
[
Any
],
covariant
=
True
)
_SupportsAnextT
=
TypeVar
(
"_SupportsAnextT"
,
bound
=
SupportsAnext
[
Any
],
covariant
=
True
)
_AwaitableT
=
TypeVar
(
"_AwaitableT"
,
bound
=
Awaitable
[
Any
])
_AwaitableT_co
=
TypeVar
(
"_AwaitableT_co"
,
bound
=
Awaitable
[
Any
],
covariant
=
True
)
_P
=
ParamSpec
(
"_P"
)
class
object
:
__doc__
:
str
|
None
__dict__
:
dict
[
str
,
Any
]
__module__
:
str
__annotations__
:
dict
[
str
,
Any
]
@
property
def
__class__
(
self
)
->
type
[
Self
]: ...
@
__class__
.
setter
def
__class__
(
self
,
type
:
type
[
object
],
/
)
->
None
: ...
def
__init__
(
self
)
->
None
: ...
def
__new__
(
cls
)
->
Self
: ...
# N.B. `object.__setattr__` and `object.__delattr__` are heavily special-cased by type checkers.
# Overriding them in subclasses has different semantics, even if the override has an identical signature.
def
__setattr__
(
self
,
name
:
str
,
value
:
Any
,
/
)
->
None
: ...
def
__delattr__
(
self
,
name
:
str
,
/
)
->
None
: ...
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__ne__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__str__
(
self
)
->
str
: ...
# noqa: Y029
def
__repr__
(
self
)
->
str
: ...
# noqa: Y029
def
__hash__
(
self
)
->
int
: ...
def
__format__
(
self
,
format_spec
:
str
,
/
)
->
str
: ...
def
__getattribute__
(
self
,
name
:
str
,
/
)
->
Any
: ...
def
__sizeof__
(
self
)
->
int
: ...
# return type of pickle methods is rather hard to express in the current type system
# see #6661 and https://docs.python.org/3/library/pickle.html#object.__reduce__
def
__reduce__
(
self
)
->
str
|
tuple
[
Any
, ...]: ...
def
__reduce_ex__
(
self
,
protocol
:
SupportsIndex
,
/
)
->
str
|
tuple
[
Any
, ...]: ...
if
sys
.
version_info
>=
(
3
,
11
):
def
__getstate__
(
self
)
->
object
: ...
def
__dir__
(
self
)
->
Iterable
[
str
]: ...
def
__init_subclass__
(
cls
)
->
None
: ...
@
classmethod
def
__subclasshook__
(
cls
,
subclass
:
type
,
/
)
->
bool
: ...
class
staticmethod
(
Generic
[
_P
,
_R_co
]):
@
property
def
__func__
(
self
)
->
Callable
[
_P
,
_R_co
]: ...
@
property
def
__isabstractmethod__
(
self
)
->
bool
: ...
def
__init__
(
self
,
f
:
Callable
[
_P
,
_R_co
],
/
)
->
None
: ...
@
overload
def
__get__
(
self
,
instance
:
None
,
owner
:
type
,
/
)
->
Callable
[
_P
,
_R_co
]: ...
@
overload
def
__get__
(
self
,
instance
:
_T
,
owner
:
type
[
_T
]
|
None
=
None
,
/
)
->
Callable
[
_P
,
_R_co
]: ...
if
sys
.
version_info
>=
(
3
,
10
):
__name__
:
str
__qualname__
:
str
@
property
def
__wrapped__
(
self
)
->
Callable
[
_P
,
_R_co
]: ...
def
__call__
(
self
,
*
args
:
_P
.
args
,
**
kwargs
:
_P
.
kwargs
)
->
_R_co
: ...
class
classmethod
(
Generic
[
_T
,
_P
,
_R_co
]):
@
property
def
__func__
(
self
)
->
Callable
[
Concatenate
[
type
[
_T
],
_P
],
_R_co
]: ...
@
property
def
__isabstractmethod__
(
self
)
->
bool
: ...
def
__init__
(
self
,
f
:
Callable
[
Concatenate
[
type
[
_T
],
_P
],
_R_co
],
/
)
->
None
: ...
@
overload
def
__get__
(
self
,
instance
:
_T
,
owner
:
type
[
_T
]
|
None
=
None
,
/
)
->
Callable
[
_P
,
_R_co
]: ...
@
overload
def
__get__
(
self
,
instance
:
None
,
owner
:
type
[
_T
],
/
)
->
Callable
[
_P
,
_R_co
]: ...
if
sys
.
version_info
>=
(
3
,
10
):
__name__
:
str
__qualname__
:
str
@
property
def
__wrapped__
(
self
)
->
Callable
[
Concatenate
[
type
[
_T
],
_P
],
_R_co
]: ...
class
type
:
# object.__base__ is None. Otherwise, it would be a type.
@
property
def
__base__
(
self
)
->
type
|
None
: ...
__bases__
:
tuple
[
type
, ...]
@
property
def
__basicsize__
(
self
)
->
int
: ...
@
property
def
__dict__
(
self
)
->
types
.
MappingProxyType
[
str
,
Any
]: ...
# type: ignore[override]
@
property
def
__dictoffset__
(
self
)
->
int
: ...
@
property
def
__flags__
(
self
)
->
int
: ...
@
property
def
__itemsize__
(
self
)
->
int
: ...
__module__
:
str
@
property
def
__mro__
(
self
)
->
tuple
[
type
, ...]: ...
__name__
:
str
__qualname__
:
str
@
property
def
__text_signature__
(
self
)
->
str
|
None
: ...
@
property
def
__weakrefoffset__
(
self
)
->
int
: ...
@
overload
def
__init__
(
self
,
o
:
object
,
/
)
->
None
: ...
@
overload
def
__init__
(
self
,
name
:
str
,
bases
:
tuple
[
type
, ...],
dict
:
dict
[
str
,
Any
],
/
,
**
kwds
:
Any
)
->
None
: ...
@
overload
def
__new__
(
cls
,
o
:
object
,
/
)
->
type
: ...
@
overload
def
__new__
(
cls
:
type
[
_typeshed
.
Self
],
name
:
str
,
bases
:
tuple
[
type
, ...],
namespace
:
dict
[
str
,
Any
],
/
,
**
kwds
:
Any
)
->
_typeshed
.
Self
: ...
def
__call__
(
self
,
*
args
:
Any
,
**
kwds
:
Any
)
->
Any
: ...
def
__subclasses__
(
self
:
_typeshed
.
Self
)
->
list
[
_typeshed
.
Self
]: ...
# Note: the documentation doesn't specify what the return type is, the standard
# implementation seems to be returning a list.
def
mro
(
self
)
->
list
[
type
]: ...
def
__instancecheck__
(
self
,
instance
:
Any
,
/
)
->
bool
: ...
def
__subclasscheck__
(
self
,
subclass
:
type
,
/
)
->
bool
: ...
@
classmethod
def
__prepare__
(
metacls
,
name
:
str
,
bases
:
tuple
[
type
, ...],
/
,
**
kwds
:
Any
)
->
MutableMapping
[
str
,
object
]: ...
if
sys
.
version_info
>=
(
3
,
10
):
def
__or__
(
self
,
value
:
Any
,
/
)
->
types
.
UnionType
: ...
def
__ror__
(
self
,
value
:
Any
,
/
)
->
types
.
UnionType
: ...
if
sys
.
version_info
>=
(
3
,
12
):
__type_params__
:
tuple
[
TypeVar
|
ParamSpec
|
TypeVarTuple
, ...]
class
super
:
@
overload
def
__init__
(
self
,
t
:
Any
,
obj
:
Any
,
/
)
->
None
: ...
@
overload
def
__init__
(
self
,
t
:
Any
,
/
)
->
None
: ...
@
overload
def
__init__
(
self
)
->
None
: ...
_PositiveInteger
:
TypeAlias
=
Literal
[
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
]
_NegativeInteger
:
TypeAlias
=
Literal
[
-
1
,
-
2
,
-
3
,
-
4
,
-
5
,
-
6
,
-
7
,
-
8
,
-
9
,
-
10
,
-
11
,
-
12
,
-
13
,
-
14
,
-
15
,
-
16
,
-
17
,
-
18
,
-
19
,
-
20
]
_LiteralInteger
=
_PositiveInteger
|
_NegativeInteger
|
Literal
[
0
]
# noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
class
int
:
@
overload
def
__new__
(
cls
,
x
:
ConvertibleToInt
=
...,
/
)
->
Self
: ...
@
overload
def
__new__
(
cls
,
x
:
str
|
bytes
|
bytearray
,
/
,
base
:
SupportsIndex
)
->
Self
: ...
def
as_integer_ratio
(
self
)
->
tuple
[
int
,
Literal
[
1
]]: ...
@
property
def
real
(
self
)
->
int
: ...
@
property
def
imag
(
self
)
->
Literal
[
0
]: ...
@
property
def
numerator
(
self
)
->
int
: ...
@
property
def
denominator
(
self
)
->
Literal
[
1
]: ...
def
conjugate
(
self
)
->
int
: ...
def
bit_length
(
self
)
->
int
: ...
if
sys
.
version_info
>=
(
3
,
10
):
def
bit_count
(
self
)
->
int
: ...
if
sys
.
version_info
>=
(
3
,
11
):
def
to_bytes
(
self
,
length
:
SupportsIndex
=
1
,
byteorder
:
Literal
[
"little"
,
"big"
]
=
"big"
,
*
,
signed
:
bool
=
False
)
->
bytes
: ...
@
classmethod
def
from_bytes
(
cls
,
bytes
:
Iterable
[
SupportsIndex
]
|
SupportsBytes
|
ReadableBuffer
,
byteorder
:
Literal
[
"little"
,
"big"
]
=
"big"
,
*
,
signed
:
bool
=
False
,
)
->
Self
: ...
else
:
def
to_bytes
(
self
,
length
:
SupportsIndex
,
byteorder
:
Literal
[
"little"
,
"big"
],
*
,
signed
:
bool
=
False
)
->
bytes
: ...
@
classmethod
def
from_bytes
(
cls
,
bytes
:
Iterable
[
SupportsIndex
]
|
SupportsBytes
|
ReadableBuffer
,
byteorder
:
Literal
[
"little"
,
"big"
],
*
,
signed
:
bool
=
False
,
)
->
Self
: ...
if
sys
.
version_info
>=
(
3
,
12
):
def
is_integer
(
self
)
->
Literal
[
True
]: ...
def
__add__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__sub__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__mul__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__floordiv__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__truediv__
(
self
,
value
:
int
,
/
)
->
float
: ...
def
__mod__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__divmod__
(
self
,
value
:
int
,
/
)
->
tuple
[
int
,
int
]: ...
def
__radd__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rsub__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rmul__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rfloordiv__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rtruediv__
(
self
,
value
:
int
,
/
)
->
float
: ...
def
__rmod__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rdivmod__
(
self
,
value
:
int
,
/
)
->
tuple
[
int
,
int
]: ...
@
overload
def
__pow__
(
self
,
x
:
Literal
[
0
],
/
)
->
Literal
[
1
]: ...
@
overload
def
__pow__
(
self
,
value
:
Literal
[
0
],
mod
:
None
,
/
)
->
Literal
[
1
]: ...
@
overload
def
__pow__
(
self
,
value
:
_PositiveInteger
,
mod
:
None
=
None
,
/
)
->
int
: ...
@
overload
def
__pow__
(
self
,
value
:
_NegativeInteger
,
mod
:
None
=
None
,
/
)
->
float
: ...
# positive __value -> int; negative __value -> float
# return type must be Any as `int | float` causes too many false-positive errors
@
overload
def
__pow__
(
self
,
value
:
int
,
mod
:
None
=
None
,
/
)
->
Any
: ...
@
overload
def
__pow__
(
self
,
value
:
int
,
mod
:
int
,
/
)
->
int
: ...
def
__rpow__
(
self
,
value
:
int
,
mod
:
int
|
None
=
None
,
/
)
->
Any
: ...
def
__and__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__or__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__xor__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__lshift__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rshift__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rand__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__ror__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rxor__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rlshift__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__rrshift__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__neg__
(
self
)
->
int
: ...
def
__pos__
(
self
)
->
int
: ...
def
__invert__
(
self
)
->
int
: ...
def
__trunc__
(
self
)
->
int
: ...
def
__ceil__
(
self
)
->
int
: ...
def
__floor__
(
self
)
->
int
: ...
def
__round__
(
self
,
ndigits
:
SupportsIndex
=
...,
/
)
->
int
: ...
def
__getnewargs__
(
self
)
->
tuple
[
int
]: ...
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__ne__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__lt__
(
self
,
value
:
int
,
/
)
->
bool
: ...
def
__le__
(
self
,
value
:
int
,
/
)
->
bool
: ...
def
__gt__
(
self
,
value
:
int
,
/
)
->
bool
: ...
def
__ge__
(
self
,
value
:
int
,
/
)
->
bool
: ...
def
__float__
(
self
)
->
float
: ...
def
__int__
(
self
)
->
int
: ...
def
__abs__
(
self
)
->
int
: ...
def
__hash__
(
self
)
->
int
: ...
def
__bool__
(
self
)
->
bool
: ...
def
__index__
(
self
)
->
int
: ...
class
float
:
def
__new__
(
cls
,
x
:
ConvertibleToFloat
=
...,
/
)
->
Self
: ...
def
as_integer_ratio
(
self
)
->
tuple
[
int
,
int
]: ...
def
hex
(
self
)
->
str
: ...
def
is_integer
(
self
)
->
bool
: ...
@
classmethod
def
fromhex
(
cls
,
string
:
str
,
/
)
->
Self
: ...
@
property
def
real
(
self
)
->
float
: ...
@
property
def
imag
(
self
)
->
float
: ...
def
conjugate
(
self
)
->
float
: ...
def
__add__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__sub__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__mul__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__floordiv__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__truediv__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__mod__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__divmod__
(
self
,
value
:
float
,
/
)
->
tuple
[
float
,
float
]: ...
@
overload
def
__pow__
(
self
,
value
:
int
,
mod
:
None
=
None
,
/
)
->
float
: ...
# positive __value -> float; negative __value -> complex
# return type must be Any as `float | complex` causes too many false-positive errors
@
overload
def
__pow__
(
self
,
value
:
float
,
mod
:
None
=
None
,
/
)
->
Any
: ...
def
__radd__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__rsub__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__rmul__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__rfloordiv__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__rtruediv__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__rmod__
(
self
,
value
:
float
,
/
)
->
float
: ...
def
__rdivmod__
(
self
,
value
:
float
,
/
)
->
tuple
[
float
,
float
]: ...
@
overload
def
__rpow__
(
self
,
value
:
_PositiveInteger
,
mod
:
None
=
None
,
/
)
->
float
: ...
@
overload
def
__rpow__
(
self
,
value
:
_NegativeInteger
,
mod
:
None
=
None
,
/
)
->
complex
: ...
# Returning `complex` for the general case gives too many false-positive errors.
@
overload
def
__rpow__
(
self
,
value
:
float
,
mod
:
None
=
None
,
/
)
->
Any
: ...
def
__getnewargs__
(
self
)
->
tuple
[
float
]: ...
def
__trunc__
(
self
)
->
int
: ...
if
sys
.
version_info
>=
(
3
,
9
):
def
__ceil__
(
self
)
->
int
: ...
def
__floor__
(
self
)
->
int
: ...
@
overload
def
__round__
(
self
,
ndigits
:
None
=
None
,
/
)
->
int
: ...
@
overload
def
__round__
(
self
,
ndigits
:
SupportsIndex
,
/
)
->
float
: ...
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__ne__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__lt__
(
self
,
value
:
float
,
/
)
->
bool
: ...
def
__le__
(
self
,
value
:
float
,
/
)
->
bool
: ...
def
__gt__
(
self
,
value
:
float
,
/
)
->
bool
: ...
def
__ge__
(
self
,
value
:
float
,
/
)
->
bool
: ...
def
__neg__
(
self
)
->
float
: ...
def
__pos__
(
self
)
->
float
: ...
def
__int__
(
self
)
->
int
: ...
def
__float__
(
self
)
->
float
: ...
def
__abs__
(
self
)
->
float
: ...
def
__hash__
(
self
)
->
int
: ...
def
__bool__
(
self
)
->
bool
: ...
class
complex
:
# Python doesn't currently accept SupportsComplex for the second argument
@
overload
def
__new__
(
cls
,
real
:
complex
|
SupportsComplex
|
SupportsFloat
|
SupportsIndex
=
...,
imag
:
complex
|
SupportsFloat
|
SupportsIndex
=
...,
)
->
Self
: ...
@
overload
def
__new__
(
cls
,
real
:
str
|
SupportsComplex
|
SupportsFloat
|
SupportsIndex
|
complex
)
->
Self
: ...
@
property
def
real
(
self
)
->
float
: ...
@
property
def
imag
(
self
)
->
float
: ...
def
conjugate
(
self
)
->
complex
: ...
def
__add__
(
self
,
value
:
complex
,
/
)
->
complex
: ...
def
__sub__
(
self
,
value
:
complex
,
/
)
->
complex
: ...
def
__mul__
(
self
,
value
:
complex
,
/
)
->
complex
: ...
def
__pow__
(
self
,
value
:
complex
,
mod
:
None
=
None
,
/
)
->
complex
: ...
def
__truediv__
(
self
,
value
:
complex
,
/
)
->
complex
: ...
def
__radd__
(
self
,
value
:
complex
,
/
)
->
complex
: ...
def
__rsub__
(
self
,
value
:
complex
,
/
)
->
complex
: ...
def
__rmul__
(
self
,
value
:
complex
,
/
)
->
complex
: ...
def
__rpow__
(
self
,
value
:
complex
,
mod
:
None
=
None
,
/
)
->
complex
: ...
def
__rtruediv__
(
self
,
value
:
complex
,
/
)
->
complex
: ...
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__ne__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__neg__
(
self
)
->
complex
: ...
def
__pos__
(
self
)
->
complex
: ...
def
__abs__
(
self
)
->
float
: ...
def
__hash__
(
self
)
->
int
: ...
def
__bool__
(
self
)
->
bool
: ...
if
sys
.
version_info
>=
(
3
,
11
):
def
__complex__
(
self
)
->
complex
: ...
class
_FormatMapMapping
(
Protocol
):
def
__getitem__
(
self
,
key
:
str
,
/
)
->
Any
: ...
class
_TranslateTable
(
Protocol
):
def
__getitem__
(
self
,
key
:
int
,
/
)
->
str
|
int
|
None
: ...
class
str
(
Sequence
[
str
]):
@
overload
def
__new__
(
cls
,
object
:
object
=
...)
->
Self
: ...
@
overload
def
__new__
(
cls
,
object
:
ReadableBuffer
,
encoding
:
str
=
...,
errors
:
str
=
...)
->
Self
: ...
@
overload
def
capitalize
(
self
:
LiteralString
)
->
LiteralString
: ...
@
overload
def
capitalize
(
self
)
->
str
: ...
# type: ignore[misc]
@
overload
def
casefold
(
self
:
LiteralString
)
->
LiteralString
: ...
@
overload
def
casefold
(
self
)
->
str
: ...
# type: ignore[misc]
@
overload
def
center
(
self
:
LiteralString
,
width
:
SupportsIndex
,
fillchar
:
LiteralString
=
" "
,
/
)
->
LiteralString
: ...
@
overload
def
center
(
self
,
width
:
SupportsIndex
,
fillchar
:
str
=
" "
,
/
)
->
str
: ...
# type: ignore[misc]
def
count
(
self
,
sub
:
str
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
encode
(
self
,
encoding
:
str
=
"utf-8"
,
errors
:
str
=
"strict"
)
->
bytes
: ...
def
endswith
(
self
,
suffix
:
str
|
tuple
[
str
, ...],
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
bool
: ...
@
overload
def
expandtabs
(
self
:
LiteralString
,
tabsize
:
SupportsIndex
=
8
)
->
LiteralString
: ...
@
overload
def
expandtabs
(
self
,
tabsize
:
SupportsIndex
=
8
)
->
str
: ...
# type: ignore[misc]
def
find
(
self
,
sub
:
str
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
@
overload
def
format
(
self
:
LiteralString
,
*
args
:
LiteralString
,
**
kwargs
:
LiteralString
)
->
LiteralString
: ...
@
overload
def
format
(
self
,
*
args
:
object
,
**
kwargs
:
object
)
->
str
: ...
def
format_map
(
self
,
mapping
:
_FormatMapMapping
,
/
)
->
str
: ...
def
index
(
self
,
sub
:
str
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
isalnum
(
self
)
->
bool
: ...
def
isalpha
(
self
)
->
bool
: ...
def
isascii
(
self
)
->
bool
: ...
def
isdecimal
(
self
)
->
bool
: ...
def
isdigit
(
self
)
->
bool
: ...
def
isidentifier
(
self
)
->
bool
: ...
def
islower
(
self
)
->
bool
: ...
def
isnumeric
(
self
)
->
bool
: ...
def
isprintable
(
self
)
->
bool
: ...
def
isspace
(
self
)
->
bool
: ...
def
istitle
(
self
)
->
bool
: ...
def
isupper
(
self
)
->
bool
: ...
@
overload
def
join
(
self
:
LiteralString
,
iterable
:
Iterable
[
LiteralString
],
/
)
->
LiteralString
: ...
@
overload
def
join
(
self
,
iterable
:
Iterable
[
str
],
/
)
->
str
: ...
# type: ignore[misc]
@
overload
def
ljust
(
self
:
LiteralString
,
width
:
SupportsIndex
,
fillchar
:
LiteralString
=
" "
,
/
)
->
LiteralString
: ...
@
overload
def
ljust
(
self
,
width
:
SupportsIndex
,
fillchar
:
str
=
" "
,
/
)
->
str
: ...
# type: ignore[misc]
@
overload
def
lower
(
self
:
LiteralString
)
->
LiteralString
: ...
@
overload
def
lower
(
self
)
->
str
: ...
# type: ignore[misc]
@
overload
def
lstrip
(
self
:
LiteralString
,
chars
:
LiteralString
|
None
=
None
,
/
)
->
LiteralString
: ...
@
overload
def
lstrip
(
self
,
chars
:
str
|
None
=
None
,
/
)
->
str
: ...
# type: ignore[misc]
@
overload
def
partition
(
self
:
LiteralString
,
sep
:
LiteralString
,
/
)
->
tuple
[
LiteralString
,
LiteralString
,
LiteralString
]: ...
@
overload
def
partition
(
self
,
sep
:
str
,
/
)
->
tuple
[
str
,
str
,
str
]: ...
# type: ignore[misc]
if
sys
.
version_info
>=
(
3
,
13
):
@
overload
def
replace
(
self
:
LiteralString
,
old
:
LiteralString
,
new
:
LiteralString
,
/
,
count
:
SupportsIndex
=
-
1
)
->
LiteralString
: ...
@
overload
def
replace
(
self
,
old
:
str
,
new
:
str
,
/
,
count
:
SupportsIndex
=
-
1
)
->
str
: ...
# type: ignore[misc]
else
:
@
overload
def
replace
(
self
:
LiteralString
,
old
:
LiteralString
,
new
:
LiteralString
,
count
:
SupportsIndex
=
-
1
,
/
)
->
LiteralString
: ...
@
overload
def
replace
(
self
,
old
:
str
,
new
:
str
,
count
:
SupportsIndex
=
-
1
,
/
)
->
str
: ...
# type: ignore[misc]
if
sys
.
version_info
>=
(
3
,
9
):
@
overload
def
removeprefix
(
self
:
LiteralString
,
prefix
:
LiteralString
,
/
)
->
LiteralString
: ...
@
overload
def
removeprefix
(
self
,
prefix
:
str
,
/
)
->
str
: ...
# type: ignore[misc]
@
overload
def
removesuffix
(
self
:
LiteralString
,
suffix
:
LiteralString
,
/
)
->
LiteralString
: ...
@
overload
def
removesuffix
(
self
,
suffix
:
str
,
/
)
->
str
: ...
# type: ignore[misc]
def
rfind
(
self
,
sub
:
str
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
rindex
(
self
,
sub
:
str
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
@
overload
def
rjust
(
self
:
LiteralString
,
width
:
SupportsIndex
,
fillchar
:
LiteralString
=
" "
,
/
)
->
LiteralString
: ...
@
overload
def
rjust
(
self
,
width
:
SupportsIndex
,
fillchar
:
str
=
" "
,
/
)
->
str
: ...
# type: ignore[misc]
@
overload
def
rpartition
(
self
:
LiteralString
,
sep
:
LiteralString
,
/
)
->
tuple
[
LiteralString
,
LiteralString
,
LiteralString
]: ...
@
overload
def
rpartition
(
self
,
sep
:
str
,
/
)
->
tuple
[
str
,
str
,
str
]: ...
# type: ignore[misc]
@
overload
def
rsplit
(
self
:
LiteralString
,
sep
:
LiteralString
|
None
=
None
,
maxsplit
:
SupportsIndex
=
-
1
)
->
list
[
LiteralString
]: ...
@
overload
def
rsplit
(
self
,
sep
:
str
|
None
=
None
,
maxsplit
:
SupportsIndex
=
-
1
)
->
list
[
str
]: ...
# type: ignore[misc]
@
overload
def
rstrip
(
self
:
LiteralString
,
chars
:
LiteralString
|
None
=
None
,
/
)
->
LiteralString
: ...
@
overload
def
rstrip
(
self
,
chars
:
str
|
None
=
None
,
/
)
->
str
: ...
# type: ignore[misc]
@
overload
def
split
(
self
:
LiteralString
,
sep
:
LiteralString
|
None
=
None
,
maxsplit
:
SupportsIndex
=
-
1
)
->
list
[
LiteralString
]: ...
@
overload
def
split
(
self
,
sep
:
str
|
None
=
None
,
maxsplit
:
SupportsIndex
=
-
1
)
->
list
[
str
]: ...
# type: ignore[misc]
@
overload
def
splitlines
(
self
:
LiteralString
,
keepends
:
bool
=
False
)
->
list
[
LiteralString
]: ...
@
overload
def
splitlines
(
self
,
keepends
:
bool
=
False
)
->
list
[
str
]: ...
# type: ignore[misc]
def
startswith
(
self
,
prefix
:
str
|
tuple
[
str
, ...],
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
bool
: ...
@
overload
def
strip
(
self
:
LiteralString
,
chars
:
LiteralString
|
None
=
None
,
/
)
->
LiteralString
: ...
@
overload
def
strip
(
self
,
chars
:
str
|
None
=
None
,
/
)
->
str
: ...
# type: ignore[misc]
@
overload
def
swapcase
(
self
:
LiteralString
)
->
LiteralString
: ...
@
overload
def
swapcase
(
self
)
->
str
: ...
# type: ignore[misc]
@
overload
def
title
(
self
:
LiteralString
)
->
LiteralString
: ...
@
overload
def
title
(
self
)
->
str
: ...
# type: ignore[misc]
def
translate
(
self
,
table
:
_TranslateTable
,
/
)
->
str
: ...
@
overload
def
upper
(
self
:
LiteralString
)
->
LiteralString
: ...
@
overload
def
upper
(
self
)
->
str
: ...
# type: ignore[misc]
@
overload
def
zfill
(
self
:
LiteralString
,
width
:
SupportsIndex
,
/
)
->
LiteralString
: ...
@
overload
def
zfill
(
self
,
width
:
SupportsIndex
,
/
)
->
str
: ...
# type: ignore[misc]
@
staticmethod
@
overload
def
maketrans
(
x
:
dict
[
int
,
_T
]
|
dict
[
str
,
_T
]
|
dict
[
str
|
int
,
_T
],
/
)
->
dict
[
int
,
_T
]: ...
@
staticmethod
@
overload
def
maketrans
(
x
:
str
,
y
:
str
,
/
)
->
dict
[
int
,
int
]: ...
@
staticmethod
@
overload
def
maketrans
(
x
:
str
,
y
:
str
,
z
:
str
,
/
)
->
dict
[
int
,
int
|
None
]: ...
@
overload
def
__add__
(
self
:
LiteralString
,
value
:
LiteralString
,
/
)
->
LiteralString
: ...
@
overload
def
__add__
(
self
,
value
:
str
,
/
)
->
str
: ...
# type: ignore[misc]
# Incompatible with Sequence.__contains__
def
__contains__
(
self
,
key
:
str
,
/
)
->
bool
: ...
# type: ignore[override]
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__ge__
(
self
,
value
:
str
,
/
)
->
bool
: ...
@
overload
def
__getitem__
(
self
:
LiteralString
,
key
:
SupportsIndex
|
slice
,
/
)
->
LiteralString
: ...
@
overload
def
__getitem__
(
self
,
key
:
SupportsIndex
|
slice
,
/
)
->
str
: ...
# type: ignore[misc]
def
__gt__
(
self
,
value
:
str
,
/
)
->
bool
: ...
def
__hash__
(
self
)
->
int
: ...
@
overload
def
__iter__
(
self
:
LiteralString
)
->
Iterator
[
LiteralString
]: ...
@
overload
def
__iter__
(
self
)
->
Iterator
[
str
]: ...
# type: ignore[misc]
def
__le__
(
self
,
value
:
str
,
/
)
->
bool
: ...
def
__len__
(
self
)
->
int
: ...
def
__lt__
(
self
,
value
:
str
,
/
)
->
bool
: ...
@
overload
def
__mod__
(
self
:
LiteralString
,
value
:
LiteralString
|
tuple
[
LiteralString
, ...],
/
)
->
LiteralString
: ...
@
overload
def
__mod__
(
self
,
value
:
Any
,
/
)
->
str
: ...
@
overload
def
__mul__
(
self
:
LiteralString
,
value
:
SupportsIndex
,
/
)
->
LiteralString
: ...
@
overload
def
__mul__
(
self
,
value
:
SupportsIndex
,
/
)
->
str
: ...
# type: ignore[misc]
def
__ne__
(
self
,
value
:
object
,
/
)
->
bool
: ...
@
overload
def
__rmul__
(
self
:
LiteralString
,
value
:
SupportsIndex
,
/
)
->
LiteralString
: ...
@
overload
def
__rmul__
(
self
,
value
:
SupportsIndex
,
/
)
->
str
: ...
# type: ignore[misc]
def
__getnewargs__
(
self
)
->
tuple
[
str
]: ...
class
bytes
(
Sequence
[
int
]):
@
overload
def
__new__
(
cls
,
o
:
Iterable
[
SupportsIndex
]
|
SupportsIndex
|
SupportsBytes
|
ReadableBuffer
,
/
)
->
Self
: ...
@
overload
def
__new__
(
cls
,
string
:
str
,
/
,
encoding
:
str
,
errors
:
str
=
...)
->
Self
: ...
@
overload
def
__new__
(
cls
)
->
Self
: ...
def
capitalize
(
self
)
->
bytes
: ...
def
center
(
self
,
width
:
SupportsIndex
,
fillchar
:
bytes
=
b" "
,
/
)
->
bytes
: ...
def
count
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
decode
(
self
,
encoding
:
str
=
"utf-8"
,
errors
:
str
=
"strict"
)
->
str
: ...
def
endswith
(
self
,
suffix
:
ReadableBuffer
|
tuple
[
ReadableBuffer
, ...],
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
,
)
->
bool
: ...
def
expandtabs
(
self
,
tabsize
:
SupportsIndex
=
8
)
->
bytes
: ...
def
find
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
hex
(
self
,
sep
:
str
|
bytes
=
...,
bytes_per_sep
:
SupportsIndex
=
...)
->
str
: ...
def
index
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
isalnum
(
self
)
->
bool
: ...
def
isalpha
(
self
)
->
bool
: ...
def
isascii
(
self
)
->
bool
: ...
def
isdigit
(
self
)
->
bool
: ...
def
islower
(
self
)
->
bool
: ...
def
isspace
(
self
)
->
bool
: ...
def
istitle
(
self
)
->
bool
: ...
def
isupper
(
self
)
->
bool
: ...
def
join
(
self
,
iterable_of_bytes
:
Iterable
[
ReadableBuffer
],
/
)
->
bytes
: ...
def
ljust
(
self
,
width
:
SupportsIndex
,
fillchar
:
bytes
|
bytearray
=
b" "
,
/
)
->
bytes
: ...
def
lower
(
self
)
->
bytes
: ...
def
lstrip
(
self
,
bytes
:
ReadableBuffer
|
None
=
None
,
/
)
->
bytes
: ...
def
partition
(
self
,
sep
:
ReadableBuffer
,
/
)
->
tuple
[
bytes
,
bytes
,
bytes
]: ...
def
replace
(
self
,
old
:
ReadableBuffer
,
new
:
ReadableBuffer
,
count
:
SupportsIndex
=
-
1
,
/
)
->
bytes
: ...
if
sys
.
version_info
>=
(
3
,
9
):
def
removeprefix
(
self
,
prefix
:
ReadableBuffer
,
/
)
->
bytes
: ...
def
removesuffix
(
self
,
suffix
:
ReadableBuffer
,
/
)
->
bytes
: ...
def
rfind
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
rindex
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
rjust
(
self
,
width
:
SupportsIndex
,
fillchar
:
bytes
|
bytearray
=
b" "
,
/
)
->
bytes
: ...
def
rpartition
(
self
,
sep
:
ReadableBuffer
,
/
)
->
tuple
[
bytes
,
bytes
,
bytes
]: ...
def
rsplit
(
self
,
sep
:
ReadableBuffer
|
None
=
None
,
maxsplit
:
SupportsIndex
=
-
1
)
->
list
[
bytes
]: ...
def
rstrip
(
self
,
bytes
:
ReadableBuffer
|
None
=
None
,
/
)
->
bytes
: ...
def
split
(
self
,
sep
:
ReadableBuffer
|
None
=
None
,
maxsplit
:
SupportsIndex
=
-
1
)
->
list
[
bytes
]: ...
def
splitlines
(
self
,
keepends
:
bool
=
False
)
->
list
[
bytes
]: ...
def
startswith
(
self
,
prefix
:
ReadableBuffer
|
tuple
[
ReadableBuffer
, ...],
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
,
)
->
bool
: ...
def
strip
(
self
,
bytes
:
ReadableBuffer
|
None
=
None
,
/
)
->
bytes
: ...
def
swapcase
(
self
)
->
bytes
: ...
def
title
(
self
)
->
bytes
: ...
def
translate
(
self
,
table
:
ReadableBuffer
|
None
,
/
,
delete
:
bytes
=
b""
)
->
bytes
: ...
def
upper
(
self
)
->
bytes
: ...
def
zfill
(
self
,
width
:
SupportsIndex
,
/
)
->
bytes
: ...
@
classmethod
def
fromhex
(
cls
,
string
:
str
,
/
)
->
Self
: ...
@
staticmethod
def
maketrans
(
frm
:
ReadableBuffer
,
to
:
ReadableBuffer
,
/
)
->
bytes
: ...
def
__len__
(
self
)
->
int
: ...
def
__iter__
(
self
)
->
Iterator
[
int
]: ...
def
__hash__
(
self
)
->
int
: ...
@
overload
def
__getitem__
(
self
,
key
:
SupportsIndex
,
/
)
->
int
: ...
@
overload
def
__getitem__
(
self
,
key
:
slice
,
/
)
->
bytes
: ...
def
__add__
(
self
,
value
:
ReadableBuffer
,
/
)
->
bytes
: ...
def
__mul__
(
self
,
value
:
SupportsIndex
,
/
)
->
bytes
: ...
def
__rmul__
(
self
,
value
:
SupportsIndex
,
/
)
->
bytes
: ...
def
__mod__
(
self
,
value
:
Any
,
/
)
->
bytes
: ...
# Incompatible with Sequence.__contains__
def
__contains__
(
self
,
key
:
SupportsIndex
|
ReadableBuffer
,
/
)
->
bool
: ...
# type: ignore[override]
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__ne__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__lt__
(
self
,
value
:
bytes
,
/
)
->
bool
: ...
def
__le__
(
self
,
value
:
bytes
,
/
)
->
bool
: ...
def
__gt__
(
self
,
value
:
bytes
,
/
)
->
bool
: ...
def
__ge__
(
self
,
value
:
bytes
,
/
)
->
bool
: ...
def
__getnewargs__
(
self
)
->
tuple
[
bytes
]: ...
if
sys
.
version_info
>=
(
3
,
11
):
def
__bytes__
(
self
)
->
bytes
: ...
def
__buffer__
(
self
,
flags
:
int
,
/
)
->
memoryview
: ...
class
bytearray
(
MutableSequence
[
int
]):
@
overload
def
__init__
(
self
)
->
None
: ...
@
overload
def
__init__
(
self
,
ints
:
Iterable
[
SupportsIndex
]
|
SupportsIndex
|
ReadableBuffer
,
/
)
->
None
: ...
@
overload
def
__init__
(
self
,
string
:
str
,
/
,
encoding
:
str
,
errors
:
str
=
...)
->
None
: ...
def
append
(
self
,
item
:
SupportsIndex
,
/
)
->
None
: ...
def
capitalize
(
self
)
->
bytearray
: ...
def
center
(
self
,
width
:
SupportsIndex
,
fillchar
:
bytes
=
b" "
,
/
)
->
bytearray
: ...
def
count
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
copy
(
self
)
->
bytearray
: ...
def
decode
(
self
,
encoding
:
str
=
"utf-8"
,
errors
:
str
=
"strict"
)
->
str
: ...
def
endswith
(
self
,
suffix
:
ReadableBuffer
|
tuple
[
ReadableBuffer
, ...],
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
,
)
->
bool
: ...
def
expandtabs
(
self
,
tabsize
:
SupportsIndex
=
8
)
->
bytearray
: ...
def
extend
(
self
,
iterable_of_ints
:
Iterable
[
SupportsIndex
],
/
)
->
None
: ...
def
find
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
hex
(
self
,
sep
:
str
|
bytes
=
...,
bytes_per_sep
:
SupportsIndex
=
...)
->
str
: ...
def
index
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
insert
(
self
,
index
:
SupportsIndex
,
item
:
SupportsIndex
,
/
)
->
None
: ...
def
isalnum
(
self
)
->
bool
: ...
def
isalpha
(
self
)
->
bool
: ...
def
isascii
(
self
)
->
bool
: ...
def
isdigit
(
self
)
->
bool
: ...
def
islower
(
self
)
->
bool
: ...
def
isspace
(
self
)
->
bool
: ...
def
istitle
(
self
)
->
bool
: ...
def
isupper
(
self
)
->
bool
: ...
def
join
(
self
,
iterable_of_bytes
:
Iterable
[
ReadableBuffer
],
/
)
->
bytearray
: ...
def
ljust
(
self
,
width
:
SupportsIndex
,
fillchar
:
bytes
|
bytearray
=
b" "
,
/
)
->
bytearray
: ...
def
lower
(
self
)
->
bytearray
: ...
def
lstrip
(
self
,
bytes
:
ReadableBuffer
|
None
=
None
,
/
)
->
bytearray
: ...
def
partition
(
self
,
sep
:
ReadableBuffer
,
/
)
->
tuple
[
bytearray
,
bytearray
,
bytearray
]: ...
def
pop
(
self
,
index
:
int
=
-
1
,
/
)
->
int
: ...
def
remove
(
self
,
value
:
int
,
/
)
->
None
: ...
if
sys
.
version_info
>=
(
3
,
9
):
def
removeprefix
(
self
,
prefix
:
ReadableBuffer
,
/
)
->
bytearray
: ...
def
removesuffix
(
self
,
suffix
:
ReadableBuffer
,
/
)
->
bytearray
: ...
def
replace
(
self
,
old
:
ReadableBuffer
,
new
:
ReadableBuffer
,
count
:
SupportsIndex
=
-
1
,
/
)
->
bytearray
: ...
def
rfind
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
rindex
(
self
,
sub
:
ReadableBuffer
|
SupportsIndex
,
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
)
->
int
: ...
def
rjust
(
self
,
width
:
SupportsIndex
,
fillchar
:
bytes
|
bytearray
=
b" "
,
/
)
->
bytearray
: ...
def
rpartition
(
self
,
sep
:
ReadableBuffer
,
/
)
->
tuple
[
bytearray
,
bytearray
,
bytearray
]: ...
def
rsplit
(
self
,
sep
:
ReadableBuffer
|
None
=
None
,
maxsplit
:
SupportsIndex
=
-
1
)
->
list
[
bytearray
]: ...
def
rstrip
(
self
,
bytes
:
ReadableBuffer
|
None
=
None
,
/
)
->
bytearray
: ...
def
split
(
self
,
sep
:
ReadableBuffer
|
None
=
None
,
maxsplit
:
SupportsIndex
=
-
1
)
->
list
[
bytearray
]: ...
def
splitlines
(
self
,
keepends
:
bool
=
False
)
->
list
[
bytearray
]: ...
def
startswith
(
self
,
prefix
:
ReadableBuffer
|
tuple
[
ReadableBuffer
, ...],
start
:
SupportsIndex
|
None
=
...,
end
:
SupportsIndex
|
None
=
...,
/
,
)
->
bool
: ...
def
strip
(
self
,
bytes
:
ReadableBuffer
|
None
=
None
,
/
)
->
bytearray
: ...
def
swapcase
(
self
)
->
bytearray
: ...
def
title
(
self
)
->
bytearray
: ...
def
translate
(
self
,
table
:
ReadableBuffer
|
None
,
/
,
delete
:
bytes
=
b""
)
->
bytearray
: ...
def
upper
(
self
)
->
bytearray
: ...
def
zfill
(
self
,
width
:
SupportsIndex
,
/
)
->
bytearray
: ...
@
classmethod
def
fromhex
(
cls
,
string
:
str
,
/
)
->
Self
: ...
@
staticmethod
def
maketrans
(
frm
:
ReadableBuffer
,
to
:
ReadableBuffer
,
/
)
->
bytes
: ...
def
__len__
(
self
)
->
int
: ...
def
__iter__
(
self
)
->
Iterator
[
int
]: ...
__hash__
:
ClassVar
[
None
]
# type: ignore[assignment]
@
overload
def
__getitem__
(
self
,
key
:
SupportsIndex
,
/
)
->
int
: ...
@
overload
def
__getitem__
(
self
,
key
:
slice
,
/
)
->
bytearray
: ...
@
overload
def
__setitem__
(
self
,
key
:
SupportsIndex
,
value
:
SupportsIndex
,
/
)
->
None
: ...
@
overload
def
__setitem__
(
self
,
key
:
slice
,
value
:
Iterable
[
SupportsIndex
]
|
bytes
,
/
)
->
None
: ...
def
__delitem__
(
self
,
key
:
SupportsIndex
|
slice
,
/
)
->
None
: ...
def
__add__
(
self
,
value
:
ReadableBuffer
,
/
)
->
bytearray
: ...
# The superclass wants us to accept Iterable[int], but that fails at runtime.
def
__iadd__
(
self
,
value
:
ReadableBuffer
,
/
)
->
Self
: ...
# type: ignore[override]
def
__mul__
(
self
,
value
:
SupportsIndex
,
/
)
->
bytearray
: ...
def
__rmul__
(
self
,
value
:
SupportsIndex
,
/
)
->
bytearray
: ...
def
__imul__
(
self
,
value
:
SupportsIndex
,
/
)
->
Self
: ...
def
__mod__
(
self
,
value
:
Any
,
/
)
->
bytes
: ...
# Incompatible with Sequence.__contains__
def
__contains__
(
self
,
key
:
SupportsIndex
|
ReadableBuffer
,
/
)
->
bool
: ...
# type: ignore[override]
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__ne__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__lt__
(
self
,
value
:
ReadableBuffer
,
/
)
->
bool
: ...
def
__le__
(
self
,
value
:
ReadableBuffer
,
/
)
->
bool
: ...
def
__gt__
(
self
,
value
:
ReadableBuffer
,
/
)
->
bool
: ...
def
__ge__
(
self
,
value
:
ReadableBuffer
,
/
)
->
bool
: ...
def
__alloc__
(
self
)
->
int
: ...
def
__buffer__
(
self
,
flags
:
int
,
/
)
->
memoryview
: ...
def
__release_buffer__
(
self
,
buffer
:
memoryview
,
/
)
->
None
: ...
_IntegerFormats
:
TypeAlias
=
Literal
[
"b"
,
"B"
,
"@b"
,
"@B"
,
"h"
,
"H"
,
"@h"
,
"@H"
,
"i"
,
"I"
,
"@i"
,
"@I"
,
"l"
,
"L"
,
"@l"
,
"@L"
,
"q"
,
"Q"
,
"@q"
,
"@Q"
,
"P"
,
"@P"
]
@
final
class
memoryview
(
Sequence
[
_I
]):
@
property
def
format
(
self
)
->
str
: ...
@
property
def
itemsize
(
self
)
->
int
: ...
@
property
def
shape
(
self
)
->
tuple
[
int
, ...]
|
None
: ...
@
property
def
strides
(
self
)
->
tuple
[
int
, ...]
|
None
: ...
@
property
def
suboffsets
(
self
)
->
tuple
[
int
, ...]
|
None
: ...
@
property
def
readonly
(
self
)
->
bool
: ...
@
property
def
ndim
(
self
)
->
int
: ...
@
property
def
obj
(
self
)
->
ReadableBuffer
: ...
@
property
def
c_contiguous
(
self
)
->
bool
: ...
@
property
def
f_contiguous
(
self
)
->
bool
: ...
@
property
def
contiguous
(
self
)
->
bool
: ...
@
property
def
nbytes
(
self
)
->
int
: ...
def
__new__
(
cls
,
obj
:
ReadableBuffer
)
->
Self
: ...
def
__enter__
(
self
)
->
Self
: ...
def
__exit__
(
self
,
exc_type
:
type
[
BaseException
]
|
None
,
exc_val
:
BaseException
|
None
,
exc_tb
:
TracebackType
|
None
,
/
)
->
None
: ...
@
overload
def
cast
(
self
,
format
:
Literal
[
"c"
,
"@c"
],
shape
:
list
[
int
]
|
tuple
[
int
, ...]
=
...)
->
memoryview
[
bytes
]: ...
@
overload
def
cast
(
self
,
format
:
Literal
[
"f"
,
"@f"
,
"d"
,
"@d"
],
shape
:
list
[
int
]
|
tuple
[
int
, ...]
=
...)
->
memoryview
[
float
]: ...
@
overload
def
cast
(
self
,
format
:
Literal
[
"?"
],
shape
:
list
[
int
]
|
tuple
[
int
, ...]
=
...)
->
memoryview
[
bool
]: ...
@
overload
def
cast
(
self
,
format
:
_IntegerFormats
,
shape
:
list
[
int
]
|
tuple
[
int
, ...]
=
...)
->
memoryview
: ...
@
overload
def
__getitem__
(
self
,
key
:
SupportsIndex
|
tuple
[
SupportsIndex
, ...],
/
)
->
_I
: ...
@
overload
def
__getitem__
(
self
,
key
:
slice
,
/
)
->
memoryview
[
_I
]: ...
def
__contains__
(
self
,
x
:
object
,
/
)
->
bool
: ...
def
__iter__
(
self
)
->
Iterator
[
_I
]: ...
def
__len__
(
self
)
->
int
: ...
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__hash__
(
self
)
->
int
: ...
@
overload
def
__setitem__
(
self
,
key
:
slice
,
value
:
ReadableBuffer
,
/
)
->
None
: ...
@
overload
def
__setitem__
(
self
,
key
:
SupportsIndex
|
tuple
[
SupportsIndex
, ...],
value
:
SupportsIndex
,
/
)
->
None
: ...
if
sys
.
version_info
>=
(
3
,
10
):
def
tobytes
(
self
,
order
:
Literal
[
"C"
,
"F"
,
"A"
]
|
None
=
"C"
)
->
bytes
: ...
else
:
def
tobytes
(
self
,
order
:
Literal
[
"C"
,
"F"
,
"A"
]
|
None
=
None
)
->
bytes
: ...
def
tolist
(
self
)
->
list
[
int
]: ...
def
toreadonly
(
self
)
->
memoryview
: ...
def
release
(
self
)
->
None
: ...
def
hex
(
self
,
sep
:
str
|
bytes
=
...,
bytes_per_sep
:
SupportsIndex
=
...)
->
str
: ...
def
__buffer__
(
self
,
flags
:
int
,
/
)
->
memoryview
: ...
def
__release_buffer__
(
self
,
buffer
:
memoryview
,
/
)
->
None
: ...
# These are inherited from the Sequence ABC, but don't actually exist on memoryview.
# See https://github.com/python/cpython/issues/125420
index
:
ClassVar
[
None
]
# type: ignore[assignment]
count
:
ClassVar
[
None
]
# type: ignore[assignment]
@
final
class
bool
(
int
):
def
__new__
(
cls
,
o
:
object
=
...,
/
)
->
Self
: ...
# The following overloads could be represented more elegantly with a TypeVar("_B", bool, int),
# however mypy has a bug regarding TypeVar constraints (https://github.com/python/mypy/issues/11880).
@
overload
def
__and__
(
self
,
value
:
bool
,
/
)
->
bool
: ...
@
overload
def
__and__
(
self
,
value
:
int
,
/
)
->
int
: ...
@
overload
def
__or__
(
self
,
value
:
bool
,
/
)
->
bool
: ...
@
overload
def
__or__
(
self
,
value
:
int
,
/
)
->
int
: ...
@
overload
def
__xor__
(
self
,
value
:
bool
,
/
)
->
bool
: ...
@
overload
def
__xor__
(
self
,
value
:
int
,
/
)
->
int
: ...
@
overload
def
__rand__
(
self
,
value
:
bool
,
/
)
->
bool
: ...
@
overload
def
__rand__
(
self
,
value
:
int
,
/
)
->
int
: ...
@
overload
def
__ror__
(
self
,
value
:
bool
,
/
)
->
bool
: ...
@
overload
def
__ror__
(
self
,
value
:
int
,
/
)
->
int
: ...
@
overload
def
__rxor__
(
self
,
value
:
bool
,
/
)
->
bool
: ...
@
overload
def
__rxor__
(
self
,
value
:
int
,
/
)
->
int
: ...
def
__getnewargs__
(
self
)
->
tuple
[
int
]: ...
@
deprecated
(
"Will throw an error in Python 3.14. Use `not` for logical negation of bools instead."
)
def
__invert__
(
self
)
->
int
: ...
@
final
class
slice
:
@
property
def
start
(
self
)
->
Any
: ...
@
property
def
step
(
self
)
->
Any
: ...
@
property
def
stop
(
self
)
->
Any
: ...
@
overload
def
__new__
(
cls
,
stop
:
Any
,
/
)
->
Self
: ...
@
overload
def
__new__
(
cls
,
start
:
Any
,
stop
:
Any
,
step
:
Any
=
...,
/
)
->
Self
: ...
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
if
sys
.
version_info
>=
(
3
,
12
):
def
__hash__
(
self
)
->
int
: ...
else
:
__hash__
:
ClassVar
[
None
]
# type: ignore[assignment]
def
indices
(
self
,
len
:
SupportsIndex
,
/
)
->
tuple
[
int
,
int
,
int
]: ...
class
tuple
(
Sequence
[
_T_co
]):
def
__new__
(
cls
,
iterable
:
Iterable
[
_T_co
]
=
...,
/
)
->
Self
: ...
def
__len__
(
self
)
->
int
: ...
def
__contains__
(
self
,
key
:
object
,
/
)
->
bool
: ...
@
overload
def
__getitem__
(
self
,
key
:
SupportsIndex
,
/
)
->
_T_co
: ...
@
overload
def
__getitem__
(
self
,
key
:
slice
,
/
)
->
tuple
[
_T_co
, ...]: ...
def
__iter__
(
self
)
->
Iterator
[
_T_co
]: ...
def
__lt__
(
self
,
value
:
tuple
[
_T_co
, ...],
/
)
->
bool
: ...
def
__le__
(
self
,
value
:
tuple
[
_T_co
, ...],
/
)
->
bool
: ...
def
__gt__
(
self
,
value
:
tuple
[
_T_co
, ...],
/
)
->
bool
: ...
def
__ge__
(
self
,
value
:
tuple
[
_T_co
, ...],
/
)
->
bool
: ...
def
__eq__
(
self
,
value
:
object
,
/
)
->
bool
: ...
def
__hash__
(
self
)
->
int
: ...
@
overload
def
__add__
(
self
,
value
:
tuple
[
_T_co
, ...],
/
)
->
tuple
[
_T_co
, ...]: ...
@
overload
def
__add__
(
self
,
value
:
tuple
[
_T
, ...],
/
)
->
tuple
[
_T_co
|
_T
, ...]: ...
def
__mul__
(
self
,
value
:
SupportsIndex
,
/
)
->
tuple
[
_T_co
, ...]: ...
def
__rmul__
(
self
,
value
:
SupportsIndex
,
/
)
->
tuple
[
_T_co
, ...]: ...
def
count
(
self
,
value
:
Any
,
/
)
->
int
: ...
def
index
(
self
,
value
:
Any
,
start
:
SupportsIndex
=
0
,
stop
:
SupportsIndex
=
sys
.
maxsize
,
/
)
->
int
: ...
if
sys
.
version_info
>=
(
3
,
9
):
def
__class_getitem__
(
cls
,
item
:
Any
,
/
)
->
GenericAlias
: ...
# Doesn't exist at runtime, but deleting this breaks mypy and pyright. See:
# https://github.com/python/typeshed/issues/7580
# https://github.com/python/mypy/issues/8240
@
final
@
type_check_only
class
function
:
# Make sure this class definition stays roughly in line with `types.FunctionType`
@
property
def
__closure__
(
self
)
->
tuple
[
CellType
, ...]
|
None
: ...
__code__
:
CodeType
__defaults__
:
tuple
[
Any
, ...]
|
None
__dict__
:
dict
[
str
,
Any
]
@
property
def
__globals__
(
self
)
->
dict
[
str
,
Any
]: ...
__name__
:
str
__qualname__
:
str
__annotations__
:
dict
[
str
,
Any
]
__kwdefaults__
:
dict
[
str
,
Any
]
View remainder of file in raw view
推荐文章
八块腹肌的生菜
·
黑枸杞子树苗-黑枸杞子树苗促销价格、黑枸杞子树苗品牌 - 淘宝
2 天前
眼睛小的盒饭
·
金监总局:严禁财产保险公司将线下业务通过互联网方式拓展经营区域;爆炒跨境ETF“熄火”;四川信托:已签订重整投资协议丨大资管一周情报 - 21经济网
2 月前
含蓄的显示器
·
王者荣耀杨玉环新皮肤上线日期确定,与周瑜联动新皮肤曝光!_玩家_游戏_设计
3 月前
另类的牙膏
·
鸣人的假期无白屏版-鸣人的假期无白屏版无广告版5.0-地图窝
3 月前
踢足球的南瓜
·
《全球能源互联网》期刊(官网)
7 月前