Skip to main content

internal.types.collections.bytearray

Standard library Module View source
class bytearray
class bytearray
Constructors 6
__init__
__init__(self: Self, /)
__init__
__init__(self: Self, /, size: int)
__init__
__init__(self: Self, /, source: bytes)
__init__
__init__(self: Self, /, source: bytearray)
__init__
__init__(self: Self, /, source: Generator[int])
__init__
__init__(self: Self, /, source: str, encoding: str, errors: str = "strict")
Methods 56
fromhex
@staticmethod
fromhex(value: str, /) -> bytearray
fromhex(value: bytes, /) -> bytearray
fromhex(value: bytearray, /) -> bytearray
maketrans
@staticmethod
maketrans(source, replacement, /) -> bytes
copy
copy(self: Self, /) -> bytearray
append
append(self: Self, value: int, /)
extend
extend(self: Self, source: Generator[int], /)
extend(self: Self, source: bytes, /)
extend(self: Self, source: bytearray, /)
insert
insert(self: Self, index: int, value: int, /)
pop
pop(self: Self, index: int = -1, /) -> int
remove
remove(self: Self, value: int, /)
clear
clear(self: Self, /)
resize
resize(self: Self, size: int, /)
reverse
reverse(self: Self, /)
count
count(self: Self, pattern, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
index
index(self: Self, pattern, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
find
find(self: Self, pattern, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
rfind
rfind(self: Self, pattern, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
rindex
rindex(self: Self, pattern, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
startswith
startswith(self: Self, prefix, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
endswith
endswith(self: Self, suffix, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
removeprefix
removeprefix(self: Self, prefix, /) -> bytearray
removesuffix
removesuffix(self: Self, suffix, /) -> bytearray
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
isdecimal
isdecimal(self: Self) -> bool
isascii
isascii(self: Self, /) -> bool
isnumeric
isnumeric(self: Self) -> bool
isidentifier
isidentifier(self: Self) -> bool
isprintable
isprintable(self: Self) -> bool
capitalize
capitalize(self: Self, /) -> bytearray
lower
lower(self: Self, /) -> bytearray
upper
upper(self: Self, /) -> bytearray
casefold
casefold(self: Self) -> bytearray
swapcase
swapcase(self: Self, /) -> bytearray
title
title(self: Self, /) -> bytearray
ljust
ljust(self: Self, width: int, fillchar: bytes = " ", /) -> bytearray
rjust
rjust(self: Self, width: int, fillchar: bytes = " ", /) -> bytearray
center
center(self: Self, width: int, fillchar: bytes = " ", /) -> bytearray
zfill
zfill(self: Self, width: int, /) -> bytearray
lstrip
lstrip(self: Self, chars: Optional[bytes] = None, /) -> bytearray
rstrip
rstrip(self: Self, chars: Optional[bytes] = None, /) -> bytearray
strip
strip(self: Self, chars: Optional[bytes] = None, /) -> bytearray
partition
partition(self: Self, separator: bytes, /) -> Tuple[(bytearray, bytearray, bytearray)]
rpartition
rpartition(self: Self, separator: bytes, /) -> Tuple[(bytearray, bytearray, bytearray)]
split
split(self: Self, /, sep: Optional[bytes] = None, maxsplit: int = -1) -> List[bytearray]
rsplit
rsplit(self: Self, /, sep: Optional[bytes] = None, maxsplit: int = -1) -> List[bytearray]
splitlines
splitlines(self: Self, /, keepends: bool = False) -> List[bytearray]
replace
replace(self: Self, old: bytes, new: bytes, count: int = -1, /) -> bytearray
expandtabs
expandtabs(self: Self, /, tabsize: int = 8) -> bytearray
translate
translate(self: Self, table, /) -> bytearray
translate(self: Self, table: bytes, /, delete: bytes = "") -> bytearray
translate(self: Self, table: bytearray, /, delete: bytes = "") -> bytearray
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
join
join[T: type](self: Self, values: Generator[T], /) -> bytearray
join[T: type](self: Self, values: List[T], /) -> bytearray
decode
decode(self: Self, /, encoding: str = "utf-8", errors: str = "strict") -> str
Special methods 24
__len__
__len__(self: Self, /) -> int
__bool__
__bool__(self: Self) -> bool
__iter__
__iter__(self: Self, /) -> Generator[int]
__reversed__
__reversed__(self: Self) -> Generator[int]
__getitem__
__getitem__(self: Self, index: int, /) -> int
__getitem__(self: Self, slice: Slice, /) -> bytearray
__setitem__
__setitem__(self: Self, slice: Slice, source: Generator[int], /)
__setitem__(self: Self, index: int, value: int, /)
__setitem__(self: Self, slice: Slice, source: bytes, /)
__setitem__(self: Self, slice: Slice, source: bytearray, /)
__delitem__
__delitem__(self: Self, index: int, /)
__delitem__(self: Self, slice: Slice, /)
__contains__
__contains__(self: Self, value: int, /) -> bool
__contains__(self: Self, pattern: bytes, /) -> bool
__contains__(self: Self, pattern: bytearray, /) -> bool
__bytes__
__bytes__(self: Self) -> bytes
__str__
__str__(self: Self, /) -> str
__repr__
__repr__(self: Self, /) -> str
__copy__
__copy__(self: Self) -> bytearray
__deepcopy__
__deepcopy__(self: Self) -> bytearray
__eq__
__eq__(self: Self, other: bytearray, /) -> bool
__eq__(self: Self, other: bytes, /) -> bool
__ne__
__ne__(self: Self, other: bytearray, /) -> bool
__ne__(self: Self, other: bytes, /) -> bool
__lt__
__lt__(self: Self, other: bytearray, /) -> bool
__lt__(self: Self, other: bytes, /) -> bool
__le__
__le__(self: Self, other: bytearray, /) -> bool
__le__(self: Self, other: bytes, /) -> bool
__gt__
__gt__(self: Self, other: bytearray, /) -> bool
__gt__(self: Self, other: bytes, /) -> bool
__ge__
__ge__(self: Self, other: bytearray, /) -> bool
__ge__(self: Self, other: bytes, /) -> bool
__add__
__add__(self: Self, other: bytearray, /) -> bytearray
__add__(self: Self, other: bytes, /) -> bytearray
__iadd__
__iadd__(self: Self, other: bytearray, /) -> bytearray
__iadd__(self: Self, other: bytes, /) -> bytearray
__mul__
__mul__(self: Self, count: int, /) -> bytearray
__rmul__
__rmul__(self: Self, count: int, /) -> bytearray
__imul__
__imul__(self: Self, count: int, /) -> bytearray
class bytes
@extend
class bytes
Methods 5
count
count(self: Self, sub: bytearray, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
find
find(self: Self, sub: bytearray, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
rfind
rfind(self: Self, sub: bytearray, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
startswith
startswith(self: Self, prefix: bytearray, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
endswith
endswith(self: Self, suffix: bytearray, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
Special methods 7
__eq__
__eq__(self: Self, other: bytearray, /) -> bool
__ne__
__ne__(self: Self, other: bytearray, /) -> bool
__add__
__add__(self: Self, other: bytearray, /) -> bytes
__lt__
__lt__(self: Self, other: bytearray, /) -> bool
__le__
__le__(self: Self, other: bytearray, /) -> bool
__gt__
__gt__(self: Self, other: bytearray, /) -> bool
__ge__
__ge__(self: Self, other: bytearray, /) -> bool