2022-04-26 22:00:20 +08:00
|
|
|
#api
|
2022-03-31 18:27:54 +08:00
|
|
|
from PikaObj import *
|
|
|
|
|
|
|
|
|
|
|
|
class List(TinyObj):
|
|
|
|
def __init__():
|
|
|
|
pass
|
|
|
|
|
|
|
|
# add an arg after the end of list
|
|
|
|
def append(arg: any):
|
|
|
|
pass
|
|
|
|
|
|
|
|
# get an arg by the index
|
|
|
|
def get(i: int) -> any:
|
|
|
|
pass
|
|
|
|
|
|
|
|
# set an arg by the index
|
|
|
|
def set(i: int, arg: any):
|
|
|
|
pass
|
|
|
|
|
|
|
|
# get the length of list
|
|
|
|
def len() -> int:
|
|
|
|
pass
|
|
|
|
# support for loop
|
|
|
|
def __iter__() -> any:
|
|
|
|
pass
|
|
|
|
|
|
|
|
# support for loop
|
|
|
|
def __next__() -> any:
|
|
|
|
pass
|
|
|
|
|
|
|
|
# support list[] = val
|
2022-07-29 23:40:16 +08:00
|
|
|
def __setitem__():
|
2022-03-31 18:27:54 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
# support val = list[]
|
2022-07-29 23:40:16 +08:00
|
|
|
def __getitem__() -> any:
|
2022-03-31 18:27:54 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
class Dict(TinyObj):
|
|
|
|
def __init__():
|
|
|
|
pass
|
|
|
|
|
|
|
|
# get an arg by the key
|
|
|
|
def get(key: str) -> any:
|
|
|
|
pass
|
|
|
|
|
|
|
|
# set an arg by the key
|
|
|
|
def set(key: str, arg: any):
|
|
|
|
pass
|
|
|
|
|
|
|
|
# remove an arg by the key
|
|
|
|
def remove(key: str):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def __iter__() -> any:
|
|
|
|
pass
|
|
|
|
|
|
|
|
def __next__() -> any:
|
|
|
|
pass
|
|
|
|
|
|
|
|
# support dict[] = val
|
2022-07-29 23:40:16 +08:00
|
|
|
def __setitem__():
|
2022-03-31 18:27:54 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
# support val = dict[]
|
2022-07-29 23:40:16 +08:00
|
|
|
def __getitem__() -> any:
|
2022-03-31 18:27:54 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class String(TinyObj):
|
|
|
|
def set(s:str):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def get()->str:
|
|
|
|
pass
|
|
|
|
|
|
|
|
def __iter__() -> any:
|
|
|
|
pass
|
|
|
|
|
|
|
|
def __next__() -> any:
|
|
|
|
pass
|
|
|
|
|
|
|
|
# support string[] = val
|
2022-07-29 23:40:16 +08:00
|
|
|
def __setitem__():
|
2022-03-31 18:27:54 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
# support val = string[]
|
2022-07-29 23:40:16 +08:00
|
|
|
def __getitem__() -> any:
|
2022-03-31 18:27:54 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
class ByteArray(List):
|
|
|
|
# convert a string to ByteArray
|
|
|
|
def fromString(s:str):
|
|
|
|
pass
|