1
- """Use builtin classes and functions
1
+ """Built-in classes and functions
2
2
"""
3
3
4
4
import sys
@@ -392,55 +392,55 @@ class str(Sequence[str]):
392
392
def count (
393
393
self ,
394
394
x : str ,
395
- __start : SupportsIndex | None = ...,
396
- __end : SupportsIndex | None = ...,
395
+ start : SupportsIndex | None = ...,
396
+ end : SupportsIndex | None = ...,
397
397
) -> int :
398
398
"""Get the number of non-overlapping occurences of a substring in the string.
399
399
400
- The optional ``__start `` and ``__end `` arguments can be used to specify a substring in which to count.
400
+ The optional ``start `` and ``end `` arguments can be used to specify a substring in which to count.
401
401
402
402
Example: ``count = "banana".count("na")``
403
403
404
404
:param x: The substring to count.
405
- :param __start : Optional argument to specify the start of the substring in which to count.
406
- :param __end : Optional argument to specify the end of the substring in which to count.
405
+ :param start : Optional argument to specify the start of the substring in which to count.
406
+ :param end : Optional argument to specify the end of the substring in which to count.
407
407
:return: The number of non-overlapping occurences of a substring in the string as an ``int``.
408
408
"""
409
409
...
410
410
def encode (self , encoding : str = ..., errors : str = ...) -> bytes : ...
411
411
def endswith (
412
412
self ,
413
- __suffix : str | Tuple [str , ...],
414
- __start : SupportsIndex | None = ...,
415
- __end : SupportsIndex | None = ...,
413
+ suffix : str | Tuple [str , ...],
414
+ start : SupportsIndex | None = ...,
415
+ end : SupportsIndex | None = ...,
416
416
) -> bool :
417
417
"""Check if the string ends with a substring.
418
418
419
- The optional ``__start `` and ``__end `` arguments can be used to specify the range to test.
419
+ The optional ``start `` and ``end `` arguments can be used to specify the range to test.
420
420
421
421
Example: ``ends_with_hello = "hello, world".endswith("hello")``
422
422
423
- :param __prefix : The prefix to check for.
424
- :param __start : Optional argument to specify the start of the substring to test.
425
- :param __end : Optional argument to specify the end of the substring to test.
423
+ :param prefix : The prefix to check for.
424
+ :param start : Optional argument to specify the start of the substring to test.
425
+ :param end : Optional argument to specify the end of the substring to test.
426
426
:return: ``True`` if the string ends with the substring, otherwise ``False``.
427
427
"""
428
428
...
429
429
def find (
430
430
self ,
431
- __sub : str ,
432
- __start : SupportsIndex | None = ...,
433
- __end : SupportsIndex | None = ...,
431
+ sub : str ,
432
+ start : SupportsIndex | None = ...,
433
+ end : SupportsIndex | None = ...,
434
434
) -> int :
435
435
"""Get the lowest index of where the substring is found.
436
436
437
- The optional ``__start `` and ``__end `` arguments can be used to specify a substring in which to search.
437
+ The optional ``start `` and ``end `` arguments can be used to specify a substring in which to search.
438
438
439
439
Example: ``index = "banana".find("na")``
440
440
441
- :param __sub : The substring to find.
442
- :param __start : Optional argument to specify the start of the substring in which to search.
443
- :param __end : Optional argument to specify the end of the substring in which to search.
441
+ :param sub : The substring to find.
442
+ :param start : Optional argument to specify the start of the substring in which to search.
443
+ :param end : Optional argument to specify the end of the substring in which to search.
444
444
:return: The the lowest index of where the substring is found, -1 if not found.
445
445
"""
446
446
...
@@ -509,32 +509,32 @@ class str(Sequence[str]):
509
509
:return: A copy of the string with the leading characters removed.
510
510
"""
511
511
...
512
- def replace (self , __old : str , __new : str , __count : SupportsIndex = ...) -> str :
512
+ def replace (self , old : str , new : str , count : SupportsIndex = ...) -> str :
513
513
"""Get a copy of the string with all occurrences of the old substring replaced by new.
514
514
515
515
Example: ``replaced = "apple, orange".replace("orange", "banana")``
516
516
517
- :param __old : The substring to replace.
518
- :param __new : The replacement substring.
519
- :param __count : Optional argument to specify the number of occurences of the old substring that should be replaced.
517
+ :param old : The substring to replace.
518
+ :param new : The replacement substring.
519
+ :param count : Optional argument to specify the number of occurences of the old substring that should be replaced.
520
520
:return: A copy of the string with all occurrences of the old substring replaced by new.
521
521
"""
522
522
...
523
523
def rfind (
524
524
self ,
525
- __sub : str ,
526
- __start : SupportsIndex | None = ...,
527
- __end : SupportsIndex | None = ...,
525
+ sub : str ,
526
+ start : SupportsIndex | None = ...,
527
+ end : SupportsIndex | None = ...,
528
528
) -> int :
529
529
"""Get the highest index of where the substring is found.
530
530
531
- The optional ``__start `` and ``__end `` arguments can be used to specify a substring in which to search.
531
+ The optional ``start `` and ``end `` arguments can be used to specify a substring in which to search.
532
532
533
533
Example: ``index = "banana".rfind("na")``
534
534
535
- :param __sub : The substring to find.
536
- :param __start : Optional argument to specify the start of the substring in which to search.
537
- :param __end : Optional argument to specify the end of the substring in which to search.
535
+ :param sub : The substring to find.
536
+ :param start : Optional argument to specify the start of the substring in which to search.
537
+ :param end : Optional argument to specify the end of the substring in which to search.
538
538
:return: The the highest index of where the substring is found, -1 if not found.
539
539
"""
540
540
...
@@ -561,28 +561,28 @@ class str(Sequence[str]):
561
561
) -> list [str ]: ...
562
562
def startswith (
563
563
self ,
564
- __prefix : str | Tuple [str , ...],
565
- __start : SupportsIndex | None = ...,
566
- __end : SupportsIndex | None = ...,
564
+ prefix : str | Tuple [str , ...],
565
+ start : SupportsIndex | None = ...,
566
+ end : SupportsIndex | None = ...,
567
567
) -> bool :
568
568
"""Check if the string starts with a substring.
569
569
570
- The optional ``__start `` and ``__end `` arguments can be used to specify the range to test.
570
+ The optional ``start `` and ``end `` arguments can be used to specify the range to test.
571
571
572
572
Example: ``starts_with_hello = "hello, world".startswith("hello")``
573
573
574
- :param __prefix : The prefix to check for.
575
- :param __start : Optional argument to specify the start of the substring to test.
576
- :param __end : Optional argument to specify the end of the substring to test.
574
+ :param prefix : The prefix to check for.
575
+ :param start : Optional argument to specify the start of the substring to test.
576
+ :param end : Optional argument to specify the end of the substring to test.
577
577
:return: ``True`` if the string starts with the substring, otherwise ``False``.
578
578
"""
579
579
...
580
- def strip (self , __chars : str | None = ...) -> str :
580
+ def strip (self , chars : str | None = ...) -> str :
581
581
"""Get a copy of the string with the leading and trailing characters removed.
582
582
583
583
Example: ``stripped = " hello ".strip()``
584
584
585
- :param __chars : (default=" ") The characters to be removed. Defaults to whitespace characters if not provided.
585
+ :param chars : (default=" ") The characters to be removed. Defaults to whitespace characters if not provided.
586
586
:return: A copy of the string with the leading and trailing characters removed.
587
587
"""
588
588
...
@@ -875,16 +875,16 @@ class list(MutableSequence[_T], Generic[_T]):
875
875
"""
876
876
...
877
877
def copy (self ) -> list [_T ]: ...
878
- def append (self , __object : _T ) -> None :
878
+ def append (self , object : _T ) -> None :
879
879
"""Add an item to the end of the list.
880
880
881
881
Example: ``[1, 2, 3].append(4)``
882
882
883
- :param __object : An item to add the end of the list.
883
+ :param object : An item to add the end of the list.
884
884
"""
885
885
...
886
886
def extend (self , __iterable : Iterable [_T ]) -> None : ...
887
- def pop (self , __index : SupportsIndex = ...) -> _T :
887
+ def pop (self , index : SupportsIndex = ...) -> _T :
888
888
"""Remove and return an item from the list.
889
889
890
890
If no ``index`` is provided, the last item in the list is removed.
@@ -897,34 +897,34 @@ class list(MutableSequence[_T], Generic[_T]):
897
897
"""
898
898
...
899
899
def index (
900
- self , __value : _T , __start : SupportsIndex = ..., __stop : SupportsIndex = ...
900
+ self , value : _T , start : SupportsIndex = ..., stop : SupportsIndex = ...
901
901
) -> int : ...
902
- def count (self , __value : _T ) -> int :
902
+ def count (self , value : _T ) -> int :
903
903
"""Get the number of times an item appears in the list.
904
904
905
905
Example: ``["a", "b", "a"].count("a")``
906
906
907
- :param __value : The item to count.
907
+ :param value : The item to count.
908
908
:return: The number of times an item appears in the list.
909
909
"""
910
910
...
911
- def insert (self , __index : SupportsIndex , __object : _T ) -> None :
911
+ def insert (self , index : SupportsIndex , object : _T ) -> None :
912
912
"""Insert an item into the list at a given position.
913
913
914
914
Example: ``["a", "b", "a"].insert(2, "c")``
915
915
916
- :param __index : The position at which to insert the item.
917
- :param __object : The item to insert.
916
+ :param index : The position at which to insert the item.
917
+ :param object : The item to insert.
918
918
"""
919
919
...
920
- def remove (self , __value : _T ) -> None :
920
+ def remove (self , value : _T ) -> None :
921
921
"""Remove the first occurence of a value from the list.
922
922
923
923
A ``ValueError`` is raised if the ``value`` does not appear in the list.
924
924
925
925
Example: ``["a", "b", "a"].remove("a")``
926
926
927
- :param __value : The item to remove.
927
+ :param value : The item to remove.
928
928
"""
929
929
...
930
930
def reverse (self ) -> None :
@@ -1143,12 +1143,12 @@ class _NotImplementedType(Any): # type: ignore
1143
1143
1144
1144
NotImplemented : _NotImplementedType
1145
1145
1146
- def abs (__x : SupportsAbs [_T ]) -> _T :
1146
+ def abs (x : SupportsAbs [_T ]) -> _T :
1147
1147
"""Get the absolute value of a number.
1148
1148
1149
1149
Example: ``abs(-42)``
1150
1150
1151
- :param __x : A number.
1151
+ :param x : A number.
1152
1152
:return: The length of or number of items in an object.
1153
1153
"""
1154
1154
...
@@ -1160,12 +1160,12 @@ if sys.version_info >= (3, 7):
1160
1160
def breakpoint (* args : Any , ** kws : Any ) -> None : ...
1161
1161
1162
1162
def callable (__obj : object ) -> bool : ...
1163
- def chr (__i : int ) -> str :
1163
+ def chr (i : int ) -> str :
1164
1164
"""Get a Unicode string representation of an integer.
1165
1165
1166
1166
Example: ``chr(97)``
1167
1167
1168
- :param __i : An integer within the range 0..1,114,111.
1168
+ :param i : An integer within the range 0..1,114,111.
1169
1169
:return: A Unicode string representation of a number within a valid range.
1170
1170
"""
1171
1171
...
@@ -1231,7 +1231,7 @@ def help(request: object) -> None:
1231
1231
Example: ``help("print")``
1232
1232
"""
1233
1233
...
1234
- def hex (__number : int | SupportsIndex ) -> str :
1234
+ def hex (number : int | SupportsIndex ) -> str :
1235
1235
"""Get the hexadecimal representation of an integer.
1236
1236
1237
1237
Example: ``hex(42)``
@@ -1278,7 +1278,7 @@ else:
1278
1278
__cls : type , __class_or_tuple : type | Tuple [type | Tuple [Any , ...], ...]
1279
1279
) -> bool : ...
1280
1280
1281
- def len (__obj : Sized ) -> int :
1281
+ def len (obj : Sized ) -> int :
1282
1282
"""Get the length of, or number of items in an object.
1283
1283
1284
1284
Example: ``len("Hello, world")``
@@ -1438,12 +1438,12 @@ def open(
1438
1438
closefd : bool = ...,
1439
1439
opener : _Opener | None = ...,
1440
1440
) -> IO [Any ]: ...
1441
- def ord (__c : str | bytes ) -> int :
1441
+ def ord (c : str | bytes ) -> int :
1442
1442
"""Get an integer representation of a Unicode character.
1443
1443
1444
1444
Example: ``ord("a")``
1445
1445
1446
- :param __c : A Unicode character.
1446
+ :param c : A Unicode character.
1447
1447
:return: The length of or number of items in an object.
1448
1448
"""
1449
1449
...
0 commit comments