Skip to main content

internal.types.bytes

Standard library Module View source
class bytes
@extend
class bytes
Constructors 5
__new__
@__internal__
__new__(p: Ptr[u8], l: int) -> bytes
__new__
@overload
__new__() -> bytes
__new__
@overload
__new__(what) -> bytes
__new__
@overload
__new__(what: bytes) -> bytes
__new__
__new__(what: str, encoding: str, errors: str = "strict") -> bytes
Methods 7
decode
decode(self: Self, /, encoding: str = "utf-8", errors: str = "strict") -> str
memcpy
@llvm
memcpy(dest: Ptr[u8], src: Ptr[u8], len: int) -> None
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) -> None
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) -> None
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) -> cobj
from_ptr
from_ptr(t: cobj) -> bytes
cat
cat(*args) -> bytes
Special methods 22
__str__
__str__(self: Self, /) -> str
__bytes__
__bytes__(self: Self, /) -> bytes
__len__
__len__(self: Self, /) -> int
__bool__
__bool__(self: Self) -> bool
__copy__
__copy__(self: Self) -> bytes
__deepcopy__
__deepcopy__(self: Self) -> bytes
__ptrcopy__
__ptrcopy__(self: Self) -> bytes
__add__
__add__(self: Self, other: bytes, /) -> bytes
__eq__
__eq__(self: Self, other: bytes, /) -> bool
__match__
__match__(self: Self, obj: bytes) -> bool
__ne__
__ne__(self: Self, other: bytes, /) -> bool
__hash__
__hash__(self: Self, /) -> int
__lt__
__lt__(self: Self, other: bytes, /) -> bool
__le__
__le__(self: Self, other: bytes, /) -> bool
__gt__
__gt__(self: Self, other: bytes, /) -> bool
__ge__
__ge__(self: Self, other: bytes, /) -> bool
__repr__
__repr__(self: Self, /) -> str
__getitem__
__getitem__(self: Self, idx: int, /) -> int
__getitem__(self: Self, s: Slice, /) -> bytes
__iter__
__iter__(self: Self, /) -> Generator[int]
__reversed__
__reversed__(self: Self) -> Generator[int]
__mul__
__mul__(self: Self, x: int, /) -> bytes
__rmul__
__rmul__(self: Self, x: int, /) -> bytes
class bytes
@extend
class bytes
Methods 46
fromhex
@staticmethod
fromhex(value, /) -> bytes
fromhex(value: str, /) -> bytes
fromhex(value: bytes, /) -> bytes
hex
hex(self: Self, /) -> str
hex(self: Self, /, sep: str, bytes_per_sep: int = 1) -> str
hex(self: Self, /, sep: bytes, bytes_per_sep: int = 1) -> str
maketrans
@staticmethod
maketrans(source, replacement, /) -> bytes
join
join(self: Self, l: Generator[bytes], /) -> bytes
join(self: Self, l: List[bytes], /) -> bytes
isdigit
isdigit(self: Self, /) -> bool
islower
islower(self: Self, /) -> bool
isupper
isupper(self: Self, /) -> bool
isalnum
isalnum(self: Self, /) -> bool
isalpha
isalpha(self: Self, /) -> bool
isspace
isspace(self: Self, /) -> bool
istitle
istitle(self: Self, /) -> bool
capitalize
capitalize(self: Self, /) -> bytes
isdecimal
isdecimal(self: Self) -> bool
lower
lower(self: Self, /) -> bytes
upper
upper(self: Self, /) -> bytes
isascii
isascii(self: Self, /) -> bool
casefold
casefold(self: Self) -> bytes
swapcase
swapcase(self: Self, /) -> bytes
title
title(self: Self, /) -> bytes
isnumeric
isnumeric(self: Self) -> bool
ljust
ljust(self: Self, width: int, fillchar: bytes = " ", /) -> bytes
rjust
rjust(self: Self, width: int, fillchar: bytes = " ", /) -> bytes
center
center(self: Self, width: int, fillchar: bytes = " ", /) -> bytes
zfill
zfill(self: Self, width: int, /) -> bytes
count
count(self: Self, sub: int, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
count(self: Self, sub: bytes, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
find
find(self: Self, sub: int, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
find(self: Self, sub: bytes, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
rfind
rfind(self: Self, sub: int, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
rfind(self: Self, sub: bytes, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
isidentifier
isidentifier(self: Self) -> bool
isprintable
isprintable(self: Self) -> bool
lstrip
lstrip(self: Self, chars: Optional[bytes] = None, /) -> bytes
rstrip
rstrip(self: Self, chars: Optional[bytes] = None, /) -> bytes
strip
strip(self: Self, chars: Optional[bytes] = None, /) -> bytes
partition
partition(self: Self, sep: bytes, /) -> Tuple[(bytes, bytes, bytes)]
rpartition
rpartition(self: Self, sep: bytes, /) -> Tuple[(bytes, bytes, bytes)]
split
split(self: Self, /, sep: Optional[bytes] = None, maxsplit: int = -1) -> List[bytes]
rsplit
rsplit(self: Self, /, sep: Optional[bytes] = None, maxsplit: int = -1) -> List[bytes]
splitlines
splitlines(self: Self, /, keepends: bool = False) -> List[bytes]
startswith
startswith(self: Self, prefix, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
startswith(self: Self, prefix: bytes, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
endswith
endswith(self: Self, suffix, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
endswith(self: Self, suffix: bytes, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
removeprefix
removeprefix(self: Self, prefix, /) -> bytes
removesuffix
removesuffix(self: Self, suffix, /) -> bytes
index
index(self: Self, sub, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
rindex
rindex(self: Self, sub, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
replace
replace(self: Self, old: bytes, new: bytes, maxcount: int = -1, /) -> bytes
expandtabs
expandtabs(self: Self, /, tabsize: int = 8) -> bytes
translate
translate(self: Self, map, /) -> bytes
translate(self: Self, table: bytes, /, delete: bytes = "") -> bytes
Special methods 1
__contains__
__contains__(self: Self, pattern: bytes, /) -> bool