Skip to main content

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: Self, encoding: str = "utf-8", errors: str = "strict", Self: type)
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: Self, Self: type)
from_ptr
from_ptr(t: cobj)
cat
cat(*args)
fromhex
@staticmethod
fromhex(value)
fromhex(value: str)
fromhex(value: bytes)
hex
hex(self: Self, Self: type)
hex(self: Self, sep: str, bytes_per_sep: int = 1, Self: type)
hex(self: Self, sep: bytes, bytes_per_sep: int = 1, Self: type)
maketrans
@staticmethod
maketrans(source, replacement)
join
join(self: Self, l: Generator[bytes], Self: type)
join(self: Self, l: List[bytes], Self: type)
isdigit
isdigit(self: Self, Self: type)
islower
islower(self: Self, Self: type)
isupper
isupper(self: Self, Self: type)
isalnum
isalnum(self: Self, Self: type)
isalpha
isalpha(self: Self, Self: type)
isspace
isspace(self: Self, Self: type)
istitle
istitle(self: Self, Self: type)
capitalize
capitalize(self: Self, Self: type)
isdecimal
isdecimal(self: Self, Self: type)
lower
lower(self: Self, Self: type)
upper
upper(self: Self, Self: type)
isascii
isascii(self: Self, Self: type)
casefold
casefold(self: Self, Self: type)
swapcase
swapcase(self: Self, Self: type)
title
title(self: Self, Self: type)
isnumeric
isnumeric(self: Self, Self: type)
ljust
ljust(self: Self, width: int, fillchar: bytes = " ", Self: type)
rjust
rjust(self: Self, width: int, fillchar: bytes = " ", Self: type)
center
center(self: Self, width: int, fillchar: bytes = " ", Self: type)
zfill
zfill(self: Self, width: int, Self: type)
count
count(self: Self, sub: bytes, start: int = 0, end: Optional[int] = None, Self: type)
find
find(self: Self, sub: bytes, start: int = 0, end: Optional[int] = None, Self: type)
rfind
rfind(self: Self, sub: bytes, start: int = 0, end: Optional[int] = None, Self: type)
isidentifier
isidentifier(self: Self, Self: type)
isprintable
isprintable(self: Self, Self: type)
lstrip
lstrip(self: Self, chars: Optional[bytes] = None, Self: type)
rstrip
rstrip(self: Self, chars: Optional[bytes] = None, Self: type)
strip
strip(self: Self, chars: Optional[bytes] = None, Self: type)
partition
partition(self: Self, sep: bytes, Self: type)
rpartition
rpartition(self: Self, sep: bytes, Self: type)
split
split(self: Self, sep: Optional[bytes] = None, maxsplit: int = -1, Self: type)
rsplit
rsplit(self: Self, sep: Optional[bytes] = None, maxsplit: int = -1, Self: type)
splitlines
splitlines(self: Self, keepends: bool = False, Self: type)
startswith
startswith(self: Self, prefix: bytes, start: int = 0, end: Optional[int] = None, Self: type)
endswith
endswith(self: Self, suffix: bytes, start: int = 0, end: Optional[int] = None, Self: type)
removeprefix
removeprefix(self: Self, prefix, Self: type)
removesuffix
removesuffix(self: Self, suffix, Self: type)
index
index(self: Self, sub: bytes, start: int = 0, end: Optional[int] = None, Self: type)
rindex
rindex(self: Self, sub: bytes, start: int = 0, end: Optional[int] = None, Self: type)
replace
replace(self: Self, old: bytes, new: bytes, maxcount: int = -1, Self: type)
expandtabs
expandtabs(self: Self, tabsize: int = 8, Self: type)
translate
translate(self: Self, map, Self: type)
translate(self: Self, table: bytes, delete: bytes = "", Self: type)
Special methods 29
__to_py__
__to_py__(self: Self, Self: type)
__from_py__
__from_py__(b: cobj)
__str__
__str__(self: Self, Self: type)
__bytes__
__bytes__(self: Self, Self: type)
__len__
__len__(self: Self, Self: type)
__bool__
__bool__(self: Self, Self: type)
__copy__
__copy__(self: Self, Self: type)
__deepcopy__
__deepcopy__(self: Self, Self: type)
__ptrcopy__
__ptrcopy__(self: Self, Self: type)
__add__
__add__(self: Self, other: bytes, Self: type)
__add__(self: Self, other: bytearray, Self: type)
__eq__
__eq__(self: Self, other: bytes, Self: type)
__eq__(self: Self, other: bytearray, Self: type)
__match__
__match__(self: Self, obj: bytes, Self: type)
__ne__
__ne__(self: Self, other: bytes, Self: type)
__ne__(self: Self, other: bytearray, Self: type)
__hash__
__hash__(self: Self, Self: type)
__lt__
__lt__(self: Self, other: bytes, Self: type)
__lt__(self: Self, other: bytearray, Self: type)
__le__
__le__(self: Self, other: bytes, Self: type)
__le__(self: Self, other: bytearray, Self: type)
__gt__
__gt__(self: Self, other: bytes, Self: type)
__gt__(self: Self, other: bytearray, Self: type)
__ge__
__ge__(self: Self, other: bytes, Self: type)
__ge__(self: Self, other: bytearray, Self: type)
__repr__
__repr__(self: Self, Self: type)
__getitem__
__getitem__(self: Self, idx: int, Self: type)
__getitem__(self: Self, s: Slice, Self: type)
__iter__
__iter__(self: Self, Self: type)
__reversed__
__reversed__(self: Self, Self: type)
__mul__
__mul__(self: Self, x: int, Self: type)
__rmul__
__rmul__(self: Self, x: int, Self: type)
__contains__
__contains__(self: Self, pattern: bytes, Self: type)
__mod__
__mod__(self: Self, values, Self: type)
__to_gpu__
__to_gpu__(self: Self, cache: AllocCache, Self: type)
Added by internal.gpu
__from_gpu__
__from_gpu__(self: Self, other: bytes, Self: type)
Added by internal.gpu
__from_gpu_new__
__from_gpu_new__(other: bytes)
Added by internal.gpu