PikaStdData.pyi 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. from PikaObj import *
  2. import builtins
  3. class Tuple:
  4. def __init__(self): ...
  5. def get(self, i: int) -> any:
  6. """get an arg by the index"""
  7. def len(self) -> int:
  8. """get the length of list"""
  9. def __iter__(self) -> any:
  10. """support for loop"""
  11. def __next__(self) -> any:
  12. """support for loop"""
  13. def __getitem__(self, __key: any) -> any:
  14. """support val = list[]"""
  15. def __del__(self): ...
  16. def __str__(self) -> str: ...
  17. def __len__(self) -> int: ...
  18. def __eq__(self, other: any) -> int:
  19. """support tuple == tuple"""
  20. def __add__(self, others: Tuple) -> Tuple:
  21. """support tuple + tuple"""
  22. def __mul__(self, n: int) -> Tuple:
  23. """support tuple * int"""
  24. class List(Tuple):
  25. def __init__(self): ...
  26. def append(self, arg: any):
  27. """add an arg after the end of list"""
  28. def set(self, i: int, arg: any):
  29. """set an arg by the index"""
  30. def reverse(self):
  31. """reverse the list"""
  32. def pop(self, *index) -> any:
  33. """pop the last element"""
  34. def remove(self, val: any):
  35. """remove the first element"""
  36. def insert(self, i: int, arg: any):
  37. """insert an arg before the index"""
  38. def __setitem__(self, __key: any, __val: any):
  39. """support list[] = val"""
  40. def __str__(self) -> str: ...
  41. def __add__(self, others: List) -> List:
  42. """ support list + list"""
  43. def __mul__(self, n: int) -> Tuple:
  44. """ support list * int"""
  45. class Dict:
  46. def __init__(self):
  47. """ get an arg by the key """
  48. def get(self, key: str) -> any: ...
  49. def set(self, key: str, arg: any):
  50. """ set an arg by the key """
  51. def remove(self, key: str):
  52. """ remove an arg by the key """
  53. def __iter__(self) -> any: ...
  54. def __next__(self) -> any: ...
  55. def __setitem__(self, __key: any, __val: any):
  56. """ support dict[] = val """
  57. def __getitem__(self, __key: any) -> any:
  58. """ support val = dict[] """
  59. def __del__(self): ...
  60. def __str__(self) -> str: ...
  61. def keys(self) -> dict_keys: ...
  62. def items(self) -> dict_items: ...
  63. def __len__(self) -> int: ...
  64. def __contains__(self, val: any) -> int:
  65. """ support val in dict """
  66. def update(self, other: Dict):
  67. """ update dict """
  68. def __eq__(self, other: any) -> int:
  69. """ support dict == dict """
  70. class dict_keys:
  71. def __iter__(self) -> any: ...
  72. def __next__(self) -> any: ...
  73. def __str__(self) -> str: ...
  74. def __len__(self) -> int: ...
  75. class dict_items:
  76. def __iter__(self) -> any: ...
  77. def __next__(self) -> any: ...
  78. def __str__(self) -> str: ...
  79. def __len__(self) -> int: ...
  80. class String:
  81. def __init__(self, s: str): ...
  82. def set(self, s: str): ...
  83. def get(self) -> str: ...
  84. def __iter__(self) -> any: ...
  85. def __next__(self) -> any: ...
  86. def __setitem__(self, __key: any, __val: any):
  87. """ support string[] = val """
  88. def __getitem__(self, __key: any) -> any:
  89. """ support val = string[] """
  90. def __str__(self) -> str:
  91. """ support str() """
  92. def __len__(self) -> int: ...
  93. def encode(self, *encoding) -> bytes: ...
  94. def startswith(self, prefix: str) -> int: ...
  95. def endswith(self, suffix: str) -> int: ...
  96. def isdigit(self) -> int: ...
  97. def islower(self) -> int: ...
  98. def isalnum(self) -> int: ...
  99. def isalpha(self) -> int: ...
  100. def isspace(self) -> int: ...
  101. def split(self, *s) -> List: ...
  102. def replace(self, old: str, new: str) -> str: ...
  103. def strip(self, *chrs) -> str: ...
  104. def format(self, *vars) -> str: ...
  105. def join(self, val: any) -> str: ...
  106. def find(self, sub: str) -> int: ...
  107. class ByteArray(builtins.bytearray):
  108. pass
  109. class FILEIO:
  110. def init(self, path: str, mode: str) -> int: ...
  111. def read(self, *size) -> any: ...
  112. def write(self, s: any) -> int: ...
  113. def close(self): ...
  114. def seek(self, offset: int, *fromwhere) -> int: ...
  115. def tell(self) -> int: ...
  116. def readline(self) -> str: ...
  117. def readlines(self) -> List: ...
  118. def writelines(self, lines: List): ...
  119. class Utils:
  120. def int_to_bytes(self, val: int) -> bytes:
  121. """ convert a int to bytes """