mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
65 lines
1.7 KiB
Python
65 lines
1.7 KiB
Python
from PikaObj import *
|
|
|
|
|
|
class List(TinyObj):
|
|
def __init__(self): ...
|
|
# add an arg after the end of list
|
|
def append(self, arg: any): ...
|
|
# get an arg by the index
|
|
def get(self, i: int) -> any: ...
|
|
# set an arg by the index
|
|
def set(self, i: int, arg: any): ...
|
|
# get the length of list
|
|
def len(self) -> int: ...
|
|
# support for loop
|
|
def __iter__(self) -> any: ...
|
|
# support for loop
|
|
def __next__(self) -> any: ...
|
|
# support list[] = val
|
|
def __set__(self, __key: any, __val: any): ...
|
|
# support val = list[]
|
|
def __get__(self, __key: any) -> any: ...
|
|
|
|
|
|
class Dict(TinyObj):
|
|
def __init__(self): ...
|
|
# get an arg by the key
|
|
def get(self, key: str) -> any: ...
|
|
# set an arg by the key
|
|
def set(self, key: str, arg: any): ...
|
|
# remove an arg by the key
|
|
def remove(self, key: str): ...
|
|
def __iter__(self) -> any: ...
|
|
def __next__(self) -> any: ...
|
|
# support dict[] = val
|
|
def __set__(self, __key: any, __val: any): ...
|
|
# support val = dict[]
|
|
def __get__(self, __key: any) -> any: ...
|
|
|
|
|
|
class String(TinyObj):
|
|
def __init__(self, s: str): ...
|
|
def set(self, s: str): ...
|
|
def get(self) -> str: ...
|
|
def __iter__(self) -> any: ...
|
|
def __next__(self) -> any: ...
|
|
# support string[] = val
|
|
def __set__(self, __key: any, __val: any): ...
|
|
# support val = string[]
|
|
def __get__(self, __key: any) -> any: ...
|
|
# support str()
|
|
def __str__(self) -> str: ...
|
|
|
|
def startwith(self,prefix:str)->int:...
|
|
|
|
def endwith(self,suffix:str)->int:...
|
|
|
|
class ByteArray(List):
|
|
# convert a string to ByteArray
|
|
def fromString(self, s: str): ...
|
|
|
|
|
|
class Utils(TinyObj):
|
|
# convert a int to bytes
|
|
def int_to_bytes(self, val: int) -> bytes: ...
|