bytes

Standard library class
class bytes
@tuple
class bytes
Constructors 5
__new__
@__internal__
__new__(p: Ptr[u8], l: int)
__new__
@overload
__new__()
__new__
@overload
__new__(what)
__new__
@overload
__new__(what: bytes)
__new__
__new__(what: str, encoding: str, errors: str = "strict")
Methods 53
decode
decode(self, encoding: str = "utf-8", errors: str = "strict")
memcpy
@llvm
memcpy(dest: Ptr[u8], src: Ptr[u8], len: int)
declare void @llvm.memcpy.p0i8.p0i8.i64(ptr %dest, ptr %src, i64 %len, i32 %align, i1 %isvolatile)
call void @llvm.memcpy.p0i8.p0i8.i64(ptr %dest, ptr %src, i64 %len, i32 0, i1 false)
ret {} {}
memmove
@llvm
memmove(dest: Ptr[u8], src: Ptr[u8], len: int)
declare void @llvm.memmove.p0i8.p0i8.i64(ptr %dest, ptr %src, i64 %len, i32 %align, i1 %isvolatile)
call void @llvm.memmove.p0i8.p0i8.i64(ptr %dest, ptr %src, i64 %len, i32 0, i1 false)
ret {} {}
memset
@llvm
memset(dest: Ptr[u8], val: u8, len: int)
declare void @llvm.memset.p0i8.i64(ptr %dest, i8 %val, i64 %len, i32 %align, i1 %isvolatile)
call void @llvm.memset.p0i8.i64(ptr %dest, i8 %val, i64 %len, i32 0, i1 false)
ret {} {}
c_str
c_str(self)
from_ptr
from_ptr(t: cobj)
cat
cat(*args)
fromhex
@staticmethod
fromhex(value)
fromhex(value: str)
fromhex(value: bytes)
hex
hex(self)
hex(self, sep: str, bytes_per_sep: int = 1)
hex(self, sep: bytes, bytes_per_sep: int = 1)
maketrans
@staticmethod
maketrans(source, replacement)
join
join(self, l: Generator[bytes])
join(self, l: List[bytes])
isdigit
isdigit(self)
islower
islower(self)
isupper
isupper(self)
isalnum
isalnum(self)
isalpha
isalpha(self)
isspace
isspace(self)
istitle
istitle(self)
capitalize
capitalize(self)
isdecimal
isdecimal(self)
lower
lower(self)
upper
upper(self)
isascii
isascii(self)
casefold
casefold(self)
swapcase
swapcase(self)
title
title(self)
isnumeric
isnumeric(self)
ljust
ljust(self, width: int, fillchar: bytes = " ")
rjust
rjust(self, width: int, fillchar: bytes = " ")
center
center(self, width: int, fillchar: bytes = " ")
zfill
zfill(self, width: int)
count
count(self, sub: bytes, start: int = 0, end: Optional[int] = None)
find
find(self, sub: bytes, start: int = 0, end: Optional[int] = None)
rfind
rfind(self, sub: bytes, start: int = 0, end: Optional[int] = None)
isidentifier
isidentifier(self)
isprintable
isprintable(self)
lstrip
lstrip(self, chars: Optional[bytes] = None)
rstrip
rstrip(self, chars: Optional[bytes] = None)
strip
strip(self, chars: Optional[bytes] = None)
partition
partition(self, sep: bytes)
rpartition
rpartition(self, sep: bytes)
split
split(self, sep: Optional[bytes] = None, maxsplit: int = -1)
rsplit
rsplit(self, sep: Optional[bytes] = None, maxsplit: int = -1)
splitlines
splitlines(self, keepends: bool = False)
startswith
startswith(self, prefix: bytes, start: int = 0, end: Optional[int] = None)
endswith
endswith(self, suffix: bytes, start: int = 0, end: Optional[int] = None)
removeprefix
removeprefix(self, prefix)
removesuffix
removesuffix(self, suffix)
index
index(self, sub: bytes, start: int = 0, end: Optional[int] = None)
rindex
rindex(self, sub: bytes, start: int = 0, end: Optional[int] = None)
replace
replace(self, old: bytes, new: bytes, maxcount: int = -1)
expandtabs
expandtabs(self, tabsize: int = 8)
translate
translate(self, map)
translate(self, table: bytes, delete: bytes = "")
Special methods 29
__to_py__
__to_py__(self)
__from_py__
__from_py__(b: cobj)
__mod__
__mod__(self, values)
__to_gpu__
__to_gpu__(self, cache: AllocCache)
Added by internal.gpu
__from_gpu__
__from_gpu__(self, other: bytes)
Added by internal.gpu
__from_gpu_new__
__from_gpu_new__(other: bytes)
Added by internal.gpu
__str__
__str__(self)
__bytes__
__bytes__(self)
__len__
__len__(self)
__bool__
__bool__(self)
__copy__
__copy__(self)
__deepcopy__
__deepcopy__(self)
__ptrcopy__
__ptrcopy__(self)
__add__
__add__(self, other: bytes)
__add__(self, other: bytearray)
__eq__
__eq__(self, other: bytes)
__eq__(self, other: bytearray)
__match__
__match__(self, obj: bytes)
__ne__
__ne__(self, other: bytes)
__ne__(self, other: bytearray)
__hash__
__hash__(self)
__lt__
__lt__(self, other: bytes)
__lt__(self, other: bytearray)
__le__
__le__(self, other: bytes)
__le__(self, other: bytearray)
__gt__
__gt__(self, other: bytes)
__gt__(self, other: bytearray)
__ge__
__ge__(self, other: bytes)
__ge__(self, other: bytearray)
__repr__
__repr__(self)
__getitem__
__getitem__(self, idx: int)
__getitem__(self, s: Slice)
__iter__
__iter__(self)
__reversed__
__reversed__(self)
__mul__
__mul__(self, x: int)
__rmul__
__rmul__(self, x: int)
__contains__
__contains__(self, pattern: bytes)