Skip to content

omnipy.shared.protocols.builtins

CLASS DESCRIPTION
IsBool

Protocol with the same interface as the builtin class bool.

IsByteArray

Protocol with the same interface as the builtin class bytearray.

IsBytes

Protocol with the same interface as the builtin class bytes.

IsComplex

Protocol with the same interface as the builtin class complex.

IsDict

Protocol with the same interface as the builtin class dict.

IsFloat

Protocol with the same interface as the builtin class float.

IsFrozenSet

Protocol with the same interface as the builtin class frozenset.

IsInt

Protocol with the same interface as the builtin class int.

IsList

Protocol with the same interface as the builtin class list.

IsSet

Protocol with the same interface as the builtin class set.

IsStr

Protocol with the same interface as the builtin class str.

IsTuple

Protocol with the same interface as the builtin class tuple.

frozendict

IsBool

Bases: IsInt, Protocol

Protocol with the same interface as the builtin class bool.

METHOD DESCRIPTION
as_integer_ratio
bit_count
bit_length
conjugate
from_bytes
is_integer
to_bytes
ATTRIBUTE DESCRIPTION
denominator

TYPE: Literal[1]

imag

TYPE: Literal[0]

numerator

TYPE: int

real

TYPE: int

Source code in src/omnipy/shared/protocols/builtins.py
class IsBool(IsInt, Protocol):
    """Protocol with the same interface as the builtin class `bool`.
    """
    # def __new__(cls, o: object = False, /) -> Self: ...

    # The following overloads could be represented more elegantly with a TypeVar("_B", bool, int),
    # however mypy has a bug regarding TypeVar constraints (https://github.com/python/mypy/issues/11880)
    @overload
    def __and__(self, value: bool, /) -> bool: raise AssumedToBeImplementedException
    @overload
    def __and__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __and__(self, value: int | bool, /) -> int | bool: raise AssumedToBeImplementedException

    @overload
    def __or__(self, value: bool, /) -> bool: raise AssumedToBeImplementedException
    @overload
    def __or__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __or__(self, value: int | bool, /) -> int | bool: raise AssumedToBeImplementedException

    @overload
    def __xor__(self, value: bool, /) -> bool: raise AssumedToBeImplementedException
    @overload
    def __xor__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __xor__(self, value: int | bool, /) -> int | bool: raise AssumedToBeImplementedException

    @overload
    def __rand__(self, value: bool, /) -> bool: raise AssumedToBeImplementedException
    @overload
    def __rand__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rand__(self, value: int | bool, /) -> int | bool: raise AssumedToBeImplementedException

    @overload
    def __ror__(self, value: bool, /) -> bool: raise AssumedToBeImplementedException
    @overload
    def __ror__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __ror__(self, value: int | bool, /) -> int | bool: raise AssumedToBeImplementedException

    @overload
    def __rxor__(self, value: bool, /) -> bool: raise AssumedToBeImplementedException
    @overload
    def __rxor__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rxor__(self, value: int | bool, /) -> int | bool: raise AssumedToBeImplementedException

    def __getnewargs__(self) -> tuple[int]: raise AssumedToBeImplementedException
    @deprecated('Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.')
    def __invert__(self) -> int: raise AssumedToBeImplementedException

denominator property

denominator: Literal[1]

imag property

imag: Literal[0]

numerator property

numerator: int

real property

real: int

as_integer_ratio

as_integer_ratio() -> tuple[int, Literal[1]]
Source code in src/omnipy/shared/protocols/builtins.py
def as_integer_ratio(self) -> tuple[int, Literal[1]]: raise AssumedToBeImplementedException

bit_count

bit_count() -> int
Source code in src/omnipy/shared/protocols/builtins.py
def bit_count(self) -> int: raise AssumedToBeImplementedException

bit_length

bit_length() -> int
Source code in src/omnipy/shared/protocols/builtins.py
def bit_length(self) -> int: raise AssumedToBeImplementedException

conjugate

conjugate() -> int
Source code in src/omnipy/shared/protocols/builtins.py
def conjugate(self) -> int: raise AssumedToBeImplementedException

from_bytes classmethod

from_bytes(
    bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
    byteorder: Literal["little", "big"],
    *,
    signed: bool = False,
) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
@classmethod
def from_bytes(
    cls,
    bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
    byteorder: Literal["little", "big"],
    *, 
    signed: bool = False,
) -> Self: raise AssumedToBeImplementedException

is_integer

is_integer() -> Literal[True]
Source code in src/omnipy/shared/protocols/builtins.py
def is_integer(self) -> Literal[True]: raise AssumedToBeImplementedException

to_bytes

to_bytes(
    length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = False
) -> bytes
Source code in src/omnipy/shared/protocols/builtins.py
def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = False) -> bytes: raise AssumedToBeImplementedException

IsByteArray

Bases: IsMutableSequence[int], Protocol

Protocol with the same interface as the builtin class bytearray.

METHOD DESCRIPTION
append
capitalize
center
clear

S.clear() -> None -- remove all items from S

count
decode
endswith
expandtabs
extend
find
fromhex
hex
index
insert
isalnum
isalpha
isascii
isdigit
islower
isspace
istitle
isupper
join
ljust
lower
lstrip
maketrans
partition
pop
remove
removeprefix
removesuffix
replace
resize
reverse

S.reverse() -- reverse IN PLACE

rfind
rindex
rjust
rpartition
rsplit
rstrip
split
splitlines
startswith
strip
swapcase
take_bytes
title
translate
upper
zfill
Source code in src/omnipy/shared/protocols/builtins.py
class IsByteArray(IsMutableSequence[int], Protocol):
    """Protocol with the same interface as the builtin class `bytearray`.
    """

    # @overload
    # def __init__(self) -> None: ...
    # @overload
    # def __init__(self, ints: Iterable[SupportsIndex] | SupportsIndex | ReadableBuffer, /) -> None: ...
    # @overload
    # def __init__(self, string: str, /, encoding: str, errors: str = 'strict') -> None: ...

    def append(self, item: SupportsIndex, /) -> None: raise AssumedToBeImplementedException
    def capitalize(self) -> bytearray: raise AssumedToBeImplementedException
    def center(self, width: SupportsIndex, fillchar: bytes = b' ', /) -> bytearray: raise AssumedToBeImplementedException
    def count(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    # def copy(self) -> bytearray: raise AssumedToBeImplementedException
    def decode(self, encoding: str = 'utf-8', errors: str = 'strict') -> str: raise AssumedToBeImplementedException
    def endswith(
        self,
        suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
        start: SupportsIndex | None = None,
        end: SupportsIndex | None = None,
        /,
    ) -> bool: raise AssumedToBeImplementedException
    def expandtabs(self, tabsize: SupportsIndex = 8) -> bytearray: raise AssumedToBeImplementedException
    def extend(self, iterable_of_ints: Iterable[SupportsIndex], /) -> None: raise AssumedToBeImplementedException
    def find(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    # def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = 1) -> str: ...
    def hex(self, sep: str | bytes = '', bytes_per_sep: SupportsIndex = 1) -> str: raise AssumedToBeImplementedException
    def index(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    def insert(self, index: SupportsIndex, item: SupportsIndex, /) -> None: raise AssumedToBeImplementedException
    def isalnum(self) -> bool: raise AssumedToBeImplementedException
    def isalpha(self) -> bool: raise AssumedToBeImplementedException
    def isascii(self) -> bool: raise AssumedToBeImplementedException
    def isdigit(self) -> bool: raise AssumedToBeImplementedException
    def islower(self) -> bool: raise AssumedToBeImplementedException
    def isspace(self) -> bool: raise AssumedToBeImplementedException
    def istitle(self) -> bool: raise AssumedToBeImplementedException
    def isupper(self) -> bool: raise AssumedToBeImplementedException
    def join(self, iterable_of_bytes: Iterable[ReadableBuffer], /) -> bytearray: raise AssumedToBeImplementedException
    def ljust(self, width: SupportsIndex, fillchar: bytes | bytearray = b' ', /) -> bytearray: raise AssumedToBeImplementedException
    def lower(self) -> bytearray: raise AssumedToBeImplementedException
    def lstrip(self, bytes: ReadableBuffer | None = None, /) -> bytearray: raise AssumedToBeImplementedException
    def partition(self, sep: ReadableBuffer, /) -> tuple[bytearray, bytearray, bytearray]: raise AssumedToBeImplementedException
    def pop(self, index: int = -1, /) -> int: raise AssumedToBeImplementedException
    def remove(self, value: int, /) -> None: raise AssumedToBeImplementedException
    def removeprefix(self, prefix: ReadableBuffer, /) -> bytearray: raise AssumedToBeImplementedException
    def removesuffix(self, suffix: ReadableBuffer, /) -> bytearray: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 15):
        def replace(self, old: ReadableBuffer, new: ReadableBuffer, /, count: SupportsIndex = -1) -> bytearray: raise AssumedToBeImplementedException
    else:
        def replace(self, old: ReadableBuffer, new: ReadableBuffer, count: SupportsIndex = -1, /) -> bytearray: raise AssumedToBeImplementedException

    def rfind(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    def rindex(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    def rjust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> bytearray: raise AssumedToBeImplementedException
    def rpartition(self, sep: ReadableBuffer, /) -> tuple[bytearray, bytearray, bytearray]: raise AssumedToBeImplementedException
    def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: raise AssumedToBeImplementedException
    def rstrip(self, bytes: ReadableBuffer | None = None, /) -> bytearray: raise AssumedToBeImplementedException
    def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: raise AssumedToBeImplementedException
    def splitlines(self, keepends: bool = False) -> list[bytearray]: raise AssumedToBeImplementedException
    def startswith(
        self,
        prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
        start: SupportsIndex | None = None,
        end: SupportsIndex | None = None,
        /,
    ) -> bool: raise AssumedToBeImplementedException
    def strip(self, bytes: ReadableBuffer | None = None, /) -> bytearray: raise AssumedToBeImplementedException
    def swapcase(self) -> bytearray: raise AssumedToBeImplementedException
    def title(self) -> bytearray: raise AssumedToBeImplementedException
    def translate(self, table: ReadableBuffer | None, /, delete: bytes = b'') -> bytearray: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 15):
        def take_bytes(self, n: int | None = None, /) -> bytes: raise AssumedToBeImplementedException

    def upper(self) -> bytearray: raise AssumedToBeImplementedException
    def zfill(self, width: SupportsIndex, /) -> bytearray: raise AssumedToBeImplementedException

    if sys.version_info >= (3, 14):
        @classmethod
        def fromhex(cls, string: str | ReadableBuffer, /) -> Self: raise AssumedToBeImplementedException
    else:
        @classmethod
        def fromhex(cls, string: str, /) -> Self: raise AssumedToBeImplementedException

    @staticmethod
    def maketrans(frm: ReadableBuffer, to: ReadableBuffer, /) -> bytes: raise AssumedToBeImplementedException
    def __len__(self) -> int: raise AssumedToBeImplementedException
    def __iter__(self) -> Iterator[int]: raise AssumedToBeImplementedException
    # __hash__: ClassVar[None]  # type: ignore[assignment]
    __hash__: ClassVar[None] = None  # type: ignore[assignment]

    @overload  # type: ignore[override]
    def __getitem__(self, key: SupportsIndex, /) -> int: raise AssumedToBeImplementedException
    @overload
    # def __getitem__(self, key: slice[SupportsIndex | None], /) -> bytearray: ...
    def __getitem__(self, key: slice, /) -> bytearray: raise AssumedToBeImplementedException
    def __getitem__(  # pyright: ignore[reportIncompatibleMethodOverride]
            self, key: slice | SupportsIndex, /) -> bytearray | int: raise AssumedToBeImplementedException

    @overload
    def __setitem__(self, key: SupportsIndex, value: SupportsIndex, /) -> None: raise AssumedToBeImplementedException
    @overload
    # def __setitem__(self, key: slice[SupportsIndex | None], value: Iterable[SupportsIndex] | bytes, /) -> None: ...
    def __setitem__(self, key: slice, value: Iterable[SupportsIndex] | bytes, /) -> None: raise AssumedToBeImplementedException
    def __setitem__(self, key: slice | SupportsIndex, value: Iterable[SupportsIndex] | bytes | SupportsIndex, /) -> None: raise AssumedToBeImplementedException

    # def __delitem__(self, key: SupportsIndex | slice[SupportsIndex | None], /) -> None: ...
    def __delitem__(self, key: SupportsIndex | slice, /) -> None: raise AssumedToBeImplementedException

    def __add__(self, value: ReadableBuffer, /) -> bytearray: raise AssumedToBeImplementedException
    # The superclass wants us to accept Iterable[int], but that fails at runtime.
    def __iadd__(self, value: ReadableBuffer, /) -> Self: raise AssumedToBeImplementedException  # type: ignore[override]
    def __mul__(self, value: SupportsIndex, /) -> bytearray: raise AssumedToBeImplementedException
    def __rmul__(self, value: SupportsIndex, /) -> bytearray: raise AssumedToBeImplementedException
    def __imul__(self, value: SupportsIndex, /) -> Self: raise AssumedToBeImplementedException
    def __mod__(self, value: Any, /) -> bytes: raise AssumedToBeImplementedException
    # Incompatible with Sequence.__contains__
    def __contains__(self, key: SupportsIndex | ReadableBuffer, /) -> bool: raise AssumedToBeImplementedException  # type: ignore[override]
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __ne__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __lt__(self, value: ReadableBuffer, /) -> bool: raise AssumedToBeImplementedException
    def __le__(self, value: ReadableBuffer, /) -> bool: raise AssumedToBeImplementedException
    def __gt__(self, value: ReadableBuffer, /) -> bool: raise AssumedToBeImplementedException
    def __ge__(self, value: ReadableBuffer, /) -> bool: raise AssumedToBeImplementedException
    def __alloc__(self) -> int: raise AssumedToBeImplementedException
    def __buffer__(self, flags: int, /) -> memoryview: raise AssumedToBeImplementedException
    def __release_buffer__(self, buffer: memoryview, /) -> None: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 14):
        def resize(self, size: int, /) -> None: raise AssumedToBeImplementedException

append

append(item: SupportsIndex) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def append(self, item: SupportsIndex, /) -> None: raise AssumedToBeImplementedException

capitalize

capitalize() -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def capitalize(self) -> bytearray: raise AssumedToBeImplementedException

center

center(width: SupportsIndex, fillchar: bytes = b' ') -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def center(self, width: SupportsIndex, fillchar: bytes = b' ', /) -> bytearray: raise AssumedToBeImplementedException

clear

clear() -> None

S.clear() -> None -- remove all items from S

Source code in src/omnipy/shared/protocols/typing.py
def clear(self) -> None:
    """
    S.clear() -> None -- remove all items from S
    """
    raise AssumedToBeImplementedException

count

count(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def count(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

decode

decode(encoding: str = 'utf-8', errors: str = 'strict') -> str
Source code in src/omnipy/shared/protocols/builtins.py
def decode(self, encoding: str = 'utf-8', errors: str = 'strict') -> str: raise AssumedToBeImplementedException

endswith

endswith(
    suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def endswith(
    self,
    suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
    /,
) -> bool: raise AssumedToBeImplementedException

expandtabs

expandtabs(tabsize: SupportsIndex = 8) -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def expandtabs(self, tabsize: SupportsIndex = 8) -> bytearray: raise AssumedToBeImplementedException

extend

extend(iterable_of_ints: Iterable[SupportsIndex]) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def extend(self, iterable_of_ints: Iterable[SupportsIndex], /) -> None: raise AssumedToBeImplementedException

find

find(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def find(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

fromhex classmethod

fromhex(string: str) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
@classmethod
def fromhex(cls, string: str, /) -> Self: raise AssumedToBeImplementedException

hex

hex(sep: str | bytes = '', bytes_per_sep: SupportsIndex = 1) -> str
Source code in src/omnipy/shared/protocols/builtins.py
def hex(self, sep: str | bytes = '', bytes_per_sep: SupportsIndex = 1) -> str: raise AssumedToBeImplementedException

index

index(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def index(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

insert

insert(index: SupportsIndex, item: SupportsIndex) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def insert(self, index: SupportsIndex, item: SupportsIndex, /) -> None: raise AssumedToBeImplementedException

isalnum

isalnum() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isalnum(self) -> bool: raise AssumedToBeImplementedException

isalpha

isalpha() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isalpha(self) -> bool: raise AssumedToBeImplementedException

isascii

isascii() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isascii(self) -> bool: raise AssumedToBeImplementedException

isdigit

isdigit() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isdigit(self) -> bool: raise AssumedToBeImplementedException

islower

islower() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def islower(self) -> bool: raise AssumedToBeImplementedException

isspace

isspace() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isspace(self) -> bool: raise AssumedToBeImplementedException

istitle

istitle() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def istitle(self) -> bool: raise AssumedToBeImplementedException

isupper

isupper() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isupper(self) -> bool: raise AssumedToBeImplementedException

join

join(iterable_of_bytes: Iterable[ReadableBuffer]) -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def join(self, iterable_of_bytes: Iterable[ReadableBuffer], /) -> bytearray: raise AssumedToBeImplementedException

ljust

ljust(width: SupportsIndex, fillchar: bytes | bytearray = b' ') -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def ljust(self, width: SupportsIndex, fillchar: bytes | bytearray = b' ', /) -> bytearray: raise AssumedToBeImplementedException

lower

lower() -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def lower(self) -> bytearray: raise AssumedToBeImplementedException

lstrip

lstrip(bytes: ReadableBuffer | None = None) -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def lstrip(self, bytes: ReadableBuffer | None = None, /) -> bytearray: raise AssumedToBeImplementedException

maketrans staticmethod

maketrans(frm: ReadableBuffer, to: ReadableBuffer) -> bytes
Source code in src/omnipy/shared/protocols/builtins.py
@staticmethod
def maketrans(frm: ReadableBuffer, to: ReadableBuffer, /) -> bytes: raise AssumedToBeImplementedException

partition

partition(sep: ReadableBuffer) -> tuple[bytearray, bytearray, bytearray]
Source code in src/omnipy/shared/protocols/builtins.py
def partition(self, sep: ReadableBuffer, /) -> tuple[bytearray, bytearray, bytearray]: raise AssumedToBeImplementedException

pop

pop(index: int = -1) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def pop(self, index: int = -1, /) -> int: raise AssumedToBeImplementedException

remove

remove(value: int) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def remove(self, value: int, /) -> None: raise AssumedToBeImplementedException

removeprefix

removeprefix(prefix: ReadableBuffer) -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def removeprefix(self, prefix: ReadableBuffer, /) -> bytearray: raise AssumedToBeImplementedException

removesuffix

removesuffix(suffix: ReadableBuffer) -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def removesuffix(self, suffix: ReadableBuffer, /) -> bytearray: raise AssumedToBeImplementedException

replace

replace(old: ReadableBuffer, new: ReadableBuffer, count: SupportsIndex = -1) -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def replace(self, old: ReadableBuffer, new: ReadableBuffer, count: SupportsIndex = -1, /) -> bytearray: raise AssumedToBeImplementedException

resize

resize(size: int) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def resize(self, size: int, /) -> None: raise AssumedToBeImplementedException

reverse

reverse() -> None

S.reverse() -- reverse IN PLACE

Source code in src/omnipy/shared/protocols/typing.py
def reverse(self) -> None:
    """
    S.reverse() -- reverse *IN PLACE*
    """
    raise AssumedToBeImplementedException

rfind

rfind(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def rfind(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

rindex

rindex(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def rindex(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

rjust

rjust(width: SupportsIndex, fillchar: bytes | bytearray = b' ') -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def rjust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> bytearray: raise AssumedToBeImplementedException

rpartition

rpartition(sep: ReadableBuffer) -> tuple[bytearray, bytearray, bytearray]
Source code in src/omnipy/shared/protocols/builtins.py
def rpartition(self, sep: ReadableBuffer, /) -> tuple[bytearray, bytearray, bytearray]: raise AssumedToBeImplementedException

rsplit

rsplit(sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]
Source code in src/omnipy/shared/protocols/builtins.py
def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: raise AssumedToBeImplementedException

rstrip

rstrip(bytes: ReadableBuffer | None = None) -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def rstrip(self, bytes: ReadableBuffer | None = None, /) -> bytearray: raise AssumedToBeImplementedException

split

split(sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]
Source code in src/omnipy/shared/protocols/builtins.py
def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: raise AssumedToBeImplementedException

splitlines

splitlines(keepends: bool = False) -> list[bytearray]
Source code in src/omnipy/shared/protocols/builtins.py
def splitlines(self, keepends: bool = False) -> list[bytearray]: raise AssumedToBeImplementedException

startswith

startswith(
    prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def startswith(
    self,
    prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
    /,
) -> bool: raise AssumedToBeImplementedException

strip

strip(bytes: ReadableBuffer | None = None) -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def strip(self, bytes: ReadableBuffer | None = None, /) -> bytearray: raise AssumedToBeImplementedException

swapcase

swapcase() -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def swapcase(self) -> bytearray: raise AssumedToBeImplementedException

take_bytes

take_bytes(n: int | None = None) -> bytes
Source code in src/omnipy/shared/protocols/builtins.py
def take_bytes(self, n: int | None = None, /) -> bytes: raise AssumedToBeImplementedException

title

title() -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def title(self) -> bytearray: raise AssumedToBeImplementedException

translate

translate(table: ReadableBuffer | None, /, delete: bytes = b'') -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def translate(self, table: ReadableBuffer | None, /, delete: bytes = b'') -> bytearray: raise AssumedToBeImplementedException

upper

upper() -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def upper(self) -> bytearray: raise AssumedToBeImplementedException

zfill

zfill(width: SupportsIndex) -> bytearray
Source code in src/omnipy/shared/protocols/builtins.py
def zfill(self, width: SupportsIndex, /) -> bytearray: raise AssumedToBeImplementedException

IsBytes

Bases: IsItemSequence[int], Protocol

Protocol with the same interface as the builtin class bytes.

METHOD DESCRIPTION
capitalize
center
count
decode
endswith
expandtabs
find
fromhex
hex
index
isalnum
isalpha
isascii
isdigit
islower
isspace
istitle
isupper
join
ljust
lower
lstrip
maketrans
partition
removeprefix
removesuffix
replace
rfind
rindex
rjust
rpartition
rsplit
rstrip
split
splitlines
startswith
strip
swapcase
title
translate
upper
zfill
Source code in src/omnipy/shared/protocols/builtins.py
class IsBytes(IsItemSequence[int], Protocol):
    """Protocol with the same interface as the builtin class `bytes`.
    """

    # @overload
    # def __new__(cls, o: Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, #             /) -> Self: ...
    # @overload
    # def __new__(cls, string: str, /, encoding: str, errors: str = 'strict') -> Self: ...
    # @overload
    # def __new__(cls) -> Self: ...

    # def capitalize(self) -> bytes:
    def capitalize(self) -> Self: raise AssumedToBeImplementedException
    # def center(self, width: SupportsIndex, fillchar: bytes = b" ", /) -> bytes:
    def center(self, width: SupportsIndex, fillchar: bytes = b' ', /) -> Self: raise AssumedToBeImplementedException
    def count(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    def decode(self, encoding: str = 'utf-8', errors: str = 'strict') -> str: raise AssumedToBeImplementedException
    def endswith(
        self,
        suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
        start: SupportsIndex | None = None,
        end: SupportsIndex | None = None,
        /,
        ) -> bool: raise AssumedToBeImplementedException
    # def expandtabs(self, tabsize: SupportsIndex = 8) -> bytes: ...
    def expandtabs(self, tabsize: SupportsIndex = 8) -> Self: raise AssumedToBeImplementedException
    def find(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    # def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = 1) -> str:
    def hex(self, sep: str | bytes = '', bytes_per_sep: SupportsIndex = 1) -> str: raise AssumedToBeImplementedException
    def index(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    def isalnum(self) -> bool: raise AssumedToBeImplementedException
    def isalpha(self) -> bool: raise AssumedToBeImplementedException
    def isascii(self) -> bool: raise AssumedToBeImplementedException
    def isdigit(self) -> bool: raise AssumedToBeImplementedException
    def islower(self) -> bool: raise AssumedToBeImplementedException
    def isspace(self) -> bool: raise AssumedToBeImplementedException
    def istitle(self) -> bool: raise AssumedToBeImplementedException
    def isupper(self) -> bool: raise AssumedToBeImplementedException
    # def join(self, iterable_of_bytes: Iterable[ReadableBuffer], /) -> bytes: ...
    def join(self, iterable_of_bytes: Iterable[ReadableBuffer], /) -> Self: raise AssumedToBeImplementedException
    # def ljust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> bytes: ...
    def ljust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> Self: raise AssumedToBeImplementedException
    # def lower(self) -> bytes: ...
    def lower(self) -> Self: raise AssumedToBeImplementedException
    # def lstrip(self, bytes: ReadableBuffer | None = None, /) -> bytes: ...
    def lstrip(self, bytes: ReadableBuffer | None = None, /) -> Self: raise AssumedToBeImplementedException
    # def partition(self, sep: ReadableBuffer, /) -> tuple[bytes, bytes, bytes]: ...
    def partition(self, sep: ReadableBuffer, /) -> tuple[Self, Self, Self]: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 15):
        # def replace(self, old: ReadableBuffer, new: ReadableBuffer, /, count: SupportsIndex = -1) -> bytes: ...
        def replace(self, old: ReadableBuffer, new: ReadableBuffer, /, count: SupportsIndex = -1) -> Self: raise AssumedToBeImplementedException
    else:
        # def replace(self, old: ReadableBuffer, new: ReadableBuffer, count: SupportsIndex = -1, /) -> bytes: ...
        def replace(self, old: ReadableBuffer, new: ReadableBuffer, count: SupportsIndex = -1, /) -> Self: raise AssumedToBeImplementedException

    # def removeprefix(self, prefix: ReadableBuffer, /) -> bytes: ...
    def removeprefix(self, prefix: ReadableBuffer, /) -> Self: raise AssumedToBeImplementedException
    # def removesuffix(self, suffix: ReadableBuffer, /) -> bytes: ...
    def removesuffix(self, suffix: ReadableBuffer, /) -> Self: raise AssumedToBeImplementedException
    def rfind(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    def rindex(
        self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> int: raise AssumedToBeImplementedException
    # def rjust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> bytes: ...
    def rjust(self, width: SupportsIndex, fillchar: bytes | bytearray = b' ', /) -> Self: raise AssumedToBeImplementedException
    # def rpartition(self, sep: ReadableBuffer, /) -> tuple[bytes, bytes, bytes]: ...
    def rpartition(self, sep: ReadableBuffer, /) -> tuple[Self, Self, Self]: raise AssumedToBeImplementedException
    # def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]: ...
    def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[Self]: raise AssumedToBeImplementedException
    # def rstrip(self, bytes: ReadableBuffer | None = None, /) -> bytes: ...
    def rstrip(self, bytes: ReadableBuffer | None = None, /) -> Self: raise AssumedToBeImplementedException
    # def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]: ...
    def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[Self]: raise AssumedToBeImplementedException
    # def splitlines(self, keepends: bool = False) -> list[bytes]: ...
    def splitlines(self, keepends: bool = False) -> list[Self]: raise AssumedToBeImplementedException
    def startswith(
        self,
        prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
        start: SupportsIndex | None = None,
        end: SupportsIndex | None = None,
        /,
    ) -> bool:
        raise AssumedToBeImplementedException
    # def strip(self, bytes: ReadableBuffer | None = None, /) -> bytes: ...
    def strip(self, bytes: ReadableBuffer | None = None, /) -> Self: raise AssumedToBeImplementedException
    # def swapcase(self) -> bytes: ...
    def swapcase(self) -> Self: raise AssumedToBeImplementedException
    # def title(self) -> bytes: ...
    def title(self) -> Self: raise AssumedToBeImplementedException
    # def translate(self, table: ReadableBuffer | None, /, delete: ReadableBuffer = b"") -> bytes: ...
    def translate(self, table: ReadableBuffer | None, /, delete: ReadableBuffer = b'') -> Self: raise AssumedToBeImplementedException
    # def upper(self) -> bytes: ...
    def upper(self) -> Self: raise AssumedToBeImplementedException
    # def zfill(self, width: SupportsIndex, /) -> bytes: ...
    def zfill(self, width: SupportsIndex, /) -> Self: raise AssumedToBeImplementedException

    if sys.version_info >= (3, 14):
        @classmethod
        def fromhex(cls, string: str | ReadableBuffer, /) -> Self: raise AssumedToBeImplementedException
    else:
        @classmethod
        def fromhex(cls, string: str, /) -> Self: raise AssumedToBeImplementedException

    @staticmethod
    def maketrans(frm: ReadableBuffer, to: ReadableBuffer, /) -> bytes: raise AssumedToBeImplementedException
    def __len__(self) -> int: raise AssumedToBeImplementedException
    def __iter__(self) -> Iterator[int]: raise AssumedToBeImplementedException
    def __hash__(self) -> int: raise AssumedToBeImplementedException

    @overload  # type: ignore[override]
    def __getitem__(self, key: SupportsIndex, /) -> int: raise AssumedToBeImplementedException
    @overload
    # def __getitem__(self, key: slice[SupportsIndex | None], /) -> bytes: ...
    def __getitem__(self, key: slice, /) -> Self: raise AssumedToBeImplementedException
    def __getitem__(self, key: slice | SupportsIndex, /) -> Self | int: raise AssumedToBeImplementedException

    # def __add__(self, value: ReadableBuffer, /) -> bytes: ...
    def __add__(self, value: ReadableBuffer, /) -> Self: raise AssumedToBeImplementedException
    # def __mul__(self, value: SupportsIndex, /) -> bytes: ...
    def __mul__(self, value: SupportsIndex, /) -> Self: raise AssumedToBeImplementedException
    # def __rmul__(self, value: SupportsIndex, /) -> bytes: ...
    def __rmul__(self, value: SupportsIndex, /) -> Self: raise AssumedToBeImplementedException
    # def __mod__(self, value: Any, /) -> bytes: ...
    def __mod__(self, value: Any, /) -> Self: raise AssumedToBeImplementedException
    # Incompatible with Sequence.__contains__
    def __contains__(self, key: SupportsIndex | ReadableBuffer, /) -> bool: raise AssumedToBeImplementedException
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __ne__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __lt__(self, value: bytes, /) -> bool: raise AssumedToBeImplementedException
    def __le__(self, value: bytes, /) -> bool: raise AssumedToBeImplementedException
    def __gt__(self, value: bytes, /) -> bool: raise AssumedToBeImplementedException
    def __ge__(self, value: bytes, /) -> bool: raise AssumedToBeImplementedException
    def __getnewargs__(self) -> tuple[bytes]: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 11):
        def __bytes__(self) -> bytes: raise AssumedToBeImplementedException

    def __buffer__(self, flags: int, /) -> memoryview: raise AssumedToBeImplementedException

capitalize

capitalize() -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def capitalize(self) -> Self: raise AssumedToBeImplementedException

center

center(width: SupportsIndex, fillchar: bytes = b' ') -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def center(self, width: SupportsIndex, fillchar: bytes = b' ', /) -> Self: raise AssumedToBeImplementedException

count

count(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def count(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

decode

decode(encoding: str = 'utf-8', errors: str = 'strict') -> str
Source code in src/omnipy/shared/protocols/builtins.py
def decode(self, encoding: str = 'utf-8', errors: str = 'strict') -> str: raise AssumedToBeImplementedException

endswith

endswith(
    suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def endswith(
    self,
    suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
    /,
    ) -> bool: raise AssumedToBeImplementedException

expandtabs

expandtabs(tabsize: SupportsIndex = 8) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def expandtabs(self, tabsize: SupportsIndex = 8) -> Self: raise AssumedToBeImplementedException

find

find(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def find(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

fromhex classmethod

fromhex(string: str) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
@classmethod
def fromhex(cls, string: str, /) -> Self: raise AssumedToBeImplementedException

hex

hex(sep: str | bytes = '', bytes_per_sep: SupportsIndex = 1) -> str
Source code in src/omnipy/shared/protocols/builtins.py
def hex(self, sep: str | bytes = '', bytes_per_sep: SupportsIndex = 1) -> str: raise AssumedToBeImplementedException

index

index(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def index(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

isalnum

isalnum() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isalnum(self) -> bool: raise AssumedToBeImplementedException

isalpha

isalpha() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isalpha(self) -> bool: raise AssumedToBeImplementedException

isascii

isascii() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isascii(self) -> bool: raise AssumedToBeImplementedException

isdigit

isdigit() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isdigit(self) -> bool: raise AssumedToBeImplementedException

islower

islower() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def islower(self) -> bool: raise AssumedToBeImplementedException

isspace

isspace() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isspace(self) -> bool: raise AssumedToBeImplementedException

istitle

istitle() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def istitle(self) -> bool: raise AssumedToBeImplementedException

isupper

isupper() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isupper(self) -> bool: raise AssumedToBeImplementedException

join

join(iterable_of_bytes: Iterable[ReadableBuffer]) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def join(self, iterable_of_bytes: Iterable[ReadableBuffer], /) -> Self: raise AssumedToBeImplementedException

ljust

ljust(width: SupportsIndex, fillchar: bytes | bytearray = b' ') -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def ljust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> Self: raise AssumedToBeImplementedException

lower

lower() -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def lower(self) -> Self: raise AssumedToBeImplementedException

lstrip

lstrip(bytes: ReadableBuffer | None = None) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def lstrip(self, bytes: ReadableBuffer | None = None, /) -> Self: raise AssumedToBeImplementedException

maketrans staticmethod

maketrans(frm: ReadableBuffer, to: ReadableBuffer) -> bytes
Source code in src/omnipy/shared/protocols/builtins.py
@staticmethod
def maketrans(frm: ReadableBuffer, to: ReadableBuffer, /) -> bytes: raise AssumedToBeImplementedException

partition

partition(sep: ReadableBuffer) -> tuple[Self, Self, Self]
Source code in src/omnipy/shared/protocols/builtins.py
def partition(self, sep: ReadableBuffer, /) -> tuple[Self, Self, Self]: raise AssumedToBeImplementedException

removeprefix

removeprefix(prefix: ReadableBuffer) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def removeprefix(self, prefix: ReadableBuffer, /) -> Self: raise AssumedToBeImplementedException

removesuffix

removesuffix(suffix: ReadableBuffer) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def removesuffix(self, suffix: ReadableBuffer, /) -> Self: raise AssumedToBeImplementedException

replace

replace(old: ReadableBuffer, new: ReadableBuffer, count: SupportsIndex = -1) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def replace(self, old: ReadableBuffer, new: ReadableBuffer, count: SupportsIndex = -1, /) -> Self: raise AssumedToBeImplementedException

rfind

rfind(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def rfind(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

rindex

rindex(
    sub: ReadableBuffer | SupportsIndex,
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def rindex(
    self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> int: raise AssumedToBeImplementedException

rjust

rjust(width: SupportsIndex, fillchar: bytes | bytearray = b' ') -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def rjust(self, width: SupportsIndex, fillchar: bytes | bytearray = b' ', /) -> Self: raise AssumedToBeImplementedException

rpartition

rpartition(sep: ReadableBuffer) -> tuple[Self, Self, Self]
Source code in src/omnipy/shared/protocols/builtins.py
def rpartition(self, sep: ReadableBuffer, /) -> tuple[Self, Self, Self]: raise AssumedToBeImplementedException

rsplit

rsplit(sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[Self]
Source code in src/omnipy/shared/protocols/builtins.py
def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[Self]: raise AssumedToBeImplementedException

rstrip

rstrip(bytes: ReadableBuffer | None = None) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def rstrip(self, bytes: ReadableBuffer | None = None, /) -> Self: raise AssumedToBeImplementedException

split

split(sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[Self]
Source code in src/omnipy/shared/protocols/builtins.py
def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[Self]: raise AssumedToBeImplementedException

splitlines

splitlines(keepends: bool = False) -> list[Self]
Source code in src/omnipy/shared/protocols/builtins.py
def splitlines(self, keepends: bool = False) -> list[Self]: raise AssumedToBeImplementedException

startswith

startswith(
    prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def startswith(
    self,
    prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
    /,
) -> bool:
    raise AssumedToBeImplementedException

strip

strip(bytes: ReadableBuffer | None = None) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def strip(self, bytes: ReadableBuffer | None = None, /) -> Self: raise AssumedToBeImplementedException

swapcase

swapcase() -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def swapcase(self) -> Self: raise AssumedToBeImplementedException

title

title() -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def title(self) -> Self: raise AssumedToBeImplementedException

translate

translate(table: ReadableBuffer | None, /, delete: ReadableBuffer = b'') -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def translate(self, table: ReadableBuffer | None, /, delete: ReadableBuffer = b'') -> Self: raise AssumedToBeImplementedException

upper

upper() -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def upper(self) -> Self: raise AssumedToBeImplementedException

zfill

zfill(width: SupportsIndex) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def zfill(self, width: SupportsIndex, /) -> Self: raise AssumedToBeImplementedException

IsComplex

Bases: Protocol

Protocol with the same interface as the builtin class complex.

METHOD DESCRIPTION
conjugate
from_number
ATTRIBUTE DESCRIPTION
imag

TYPE: float

real

TYPE: float

Source code in src/omnipy/shared/protocols/builtins.py
class IsComplex(Protocol):
    """Protocol with the same interface as the builtin class `complex`.
    """
    # # Python doesn't currently accept SupportsComplex for the second argument
    # @overload
    # def __new__(
    #     cls,
    #     real: complex | SupportsComplex | SupportsFloat | SupportsIndex = 0,
    #     imag: complex | SupportsFloat | SupportsIndex = 0,
    # ) -> Self: ...
    # @overload
    # def __new__(cls, real: (str | SupportsComplex | SupportsFloat | SupportsIndex | complex)) -> Self: ...

    @property
    def real(self) -> float: raise AssumedToBeImplementedException
    @property
    def imag(self) -> float: raise AssumedToBeImplementedException
    def conjugate(self) -> complex: raise AssumedToBeImplementedException
    def __add__(self, value: complex, /) -> complex: raise AssumedToBeImplementedException
    def __sub__(self, value: complex, /) -> complex: raise AssumedToBeImplementedException
    def __mul__(self, value: complex, /) -> complex: raise AssumedToBeImplementedException
    def __pow__(self, value: complex, mod: None = None, /) -> complex: raise AssumedToBeImplementedException
    def __truediv__(self, value: complex, /) -> complex: raise AssumedToBeImplementedException
    def __radd__(self, value: complex, /) -> complex: raise AssumedToBeImplementedException
    def __rsub__(self, value: complex, /) -> complex: raise AssumedToBeImplementedException
    def __rmul__(self, value: complex, /) -> complex: raise AssumedToBeImplementedException
    def __rpow__(self, value: complex, mod: None = None, /) -> complex: raise AssumedToBeImplementedException
    def __rtruediv__(self, value: complex, /) -> complex: raise AssumedToBeImplementedException
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __ne__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __neg__(self) -> complex: raise AssumedToBeImplementedException
    def __pos__(self) -> complex: raise AssumedToBeImplementedException
    def __abs__(self) -> float: raise AssumedToBeImplementedException
    def __hash__(self) -> int: raise AssumedToBeImplementedException
    def __bool__(self) -> bool: raise AssumedToBeImplementedException
    def __format__(self, format_spec: str, /) -> str: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 11):
        def __complex__(self) -> complex: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 14):
        @classmethod
        def from_number(cls, number: complex | SupportsComplex | SupportsFloat | SupportsIndex, /) -> Self: raise AssumedToBeImplementedException

imag property

imag: float

real property

real: float

conjugate

conjugate() -> complex
Source code in src/omnipy/shared/protocols/builtins.py
def conjugate(self) -> complex: raise AssumedToBeImplementedException

from_number classmethod

from_number(number: complex | SupportsComplex | SupportsFloat | SupportsIndex) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
@classmethod
def from_number(cls, number: complex | SupportsComplex | SupportsFloat | SupportsIndex, /) -> Self: raise AssumedToBeImplementedException

IsDict

Bases: IsMutableMapping[_KT, _VT], Protocol[_KT, _VT]

Protocol with the same interface as the builtin class dict.

METHOD DESCRIPTION
clear

D.clear() -> None. Remove all items from D.

fromkeys
get
items
keys
pop
popitem

D.popitem() -> (k, v), remove and return some (key, value) pair

setdefault

D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D

update

D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.

values
Source code in src/omnipy/shared/protocols/builtins.py
class IsDict(IsMutableMapping[_KT, _VT], Protocol[_KT, _VT]):
    """Protocol with the same interface as the builtin class `dict`.
    """
    # # __init__ should be kept roughly in line with `collections.UserDict.__init__`, which has similar semantics
    # # Also multiprocessing.managers.SyncManager.dict()
    # @overload
    # def __init__(self, /) -> None: ...
    # @overload
    # def __init__(self: dict[str, _VT], /, **kwargs: _VT) -> None: ...  # pyright: ignore[reportInvalidTypeVarUse]  #11780
    # @overload
    # def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ...
    # @overload
    # def __init__(
    #     self: dict[str, _VT],  # pyright: ignore[reportInvalidTypeVarUse]  #11780
    #     map: SupportsKeysAndGetItem[str, _VT],
    #     /,
    #     **kwargs: _VT,
    # ) -> None: ...
    # @overload
    # def __init__(self, iterable: Iterable[tuple[_KT, _VT]], /) -> None: ...
    # @overload
    # def __init__(
    #     self: dict[str, _VT],  # pyright: ignore[reportInvalidTypeVarUse]  #11780
    #     iterable: Iterable[tuple[str, _VT]], #     /, #     **kwargs: _VT, # ) -> None: ...
    # # Next two overloads are for dict(string.split(sep) for string in iterable)
    # # Cannot be Iterable[Sequence[_T]] or otherwise dict(["foo", "bar", "baz"]) is not an error
    # @overload
    # def __init__(self: dict[str, str], iterable: Iterable[list[str]], /) -> None: ...
    # @overload
    # def __init__(self: dict[bytes, bytes], iterable: Iterable[list[bytes]], /) -> None: ...

    # def __new__(cls, /, *args: Any, **kwargs: Any) -> Self: ...
    # def copy(self) -> dict[_KT, _VT]: raise AssumedToBeImplementedException
    # def keys(self) -> dict_keys[_KT, _VT]:
    def keys(self) -> IsDictKeys[_KT, _VT]: raise AssumedToBeImplementedException
    # def values(self) -> dict_values[_KT, _VT]:
    def values(self) -> IsDictValues[_KT, _VT]: raise AssumedToBeImplementedException
    # def items(self) -> dict_items[_KT, _VT]:
    def items(self) -> IsDictItems[_KT, _VT]: raise AssumedToBeImplementedException

    # Signature of `dict.fromkeys` should be kept identical to
    # `fromkeys` methods of `OrderedDict`/`ChainMap`/`UserDict` in `collections`
    # TODO: the true signature of `dict.fromkeys` is not expressible in the current type system.
    # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963.
    @classmethod
    @overload
    def fromkeys(cls, iterable: Iterable[_T], value: None = None, /) -> dict[_T, Any | None]: raise AssumedToBeImplementedException
    @classmethod
    @overload
    def fromkeys(cls, iterable: Iterable[_T], value: _S, /) -> dict[_T, _S]: raise AssumedToBeImplementedException
    @classmethod
    def fromkeys(
        cls, iterable: Iterable[_T], value: _S | None = None, /) -> dict[_T, _S] | dict[_T, Any | None]: raise AssumedToBeImplementedException

    # Positional-only in dict, but not in MutableMapping
    @overload
    def get(self, key: _KT, default: None = None, /) -> _VT | None: raise AssumedToBeImplementedException
    @overload
    def get(self, key: _KT, default: _VT, /) -> _VT: raise AssumedToBeImplementedException
    @overload
    def get(self, key: _KT, default: _T, /) -> _VT | _T: raise AssumedToBeImplementedException
    def get(self, key: _KT, default: None | _VT | _T = None, /) -> _VT | _T | None: raise AssumedToBeImplementedException

    @overload
    def pop(self, key: _KT, /) -> _VT: raise AssumedToBeImplementedException
    @overload
    def pop(self, key: _KT, default: _VT, /) -> _VT: raise AssumedToBeImplementedException
    @overload
    def pop(self, key: _KT, default: _T, /) -> _VT | _T: raise AssumedToBeImplementedException
    def pop(self, key: _KT, default: None | _VT | _T = None, /) -> _VT | _T | None: raise AssumedToBeImplementedException

    def __len__(self) -> int: raise AssumedToBeImplementedException
    def __getitem__(self, key: _KT, /) -> _VT: raise AssumedToBeImplementedException
    def __setitem__(self, key: _KT, value: _VT, /) -> None: raise AssumedToBeImplementedException
    def __delitem__(self, key: _KT, /) -> None: raise AssumedToBeImplementedException
    def __iter__(self) -> Iterator[_KT]: raise AssumedToBeImplementedException
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __reversed__(self) -> Iterator[_KT]: raise AssumedToBeImplementedException
    # __hash__: ClassVar[None]  # type: ignore[assignment]
    __hash__: ClassVar[None] = None  # type: ignore[assignment]
    # def __class_getitem__(cls, item: Any, /) -> GenericAlias: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 15):
        def __or__(self, value: dict[_T1, _T2] | frozendict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: raise AssumedToBeImplementedException

        @overload
        def __ror__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: raise AssumedToBeImplementedException
        @overload
        def __ror__(self, value: frozendict[_T1, _T2], /) -> frozendict[_KT | _T1, _VT | _T2]: raise AssumedToBeImplementedException
        def __ror__(self, value: dict[_T1, _T2] | frozendict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2] | frozendict[_KT | _T1, _VT | _T2]: raise AssumedToBeImplementedException
    else:
        def __or__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: raise AssumedToBeImplementedException
        def __ror__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: raise AssumedToBeImplementedException

    # dict.__ior__ should be kept roughly in line with MutableMapping.update()
    @overload  # type: ignore[misc]
    def __ior__(self, value: SupportsKeysAndGetItem[_KT, _VT], /) -> Self: raise AssumedToBeImplementedException
    @overload
    def __ior__(self, value: Iterable[tuple[_KT, _VT]], /) -> Self: raise AssumedToBeImplementedException
    def __ior__(self, value: SupportsKeysAndGetItem[_KT, _VT] | Iterable[tuple[_KT, _VT]], /) -> Self: raise AssumedToBeImplementedException

clear

clear() -> None

D.clear() -> None. Remove all items from D.

Source code in src/omnipy/shared/protocols/typing.py
def clear(self) -> None:
    """
    D.clear() -> None.  Remove all items from D.
    """
    raise AssumedToBeImplementedException

fromkeys classmethod

fromkeys(iterable: Iterable[_T], value: None = None) -> dict[_T, Any | None]
fromkeys(iterable: Iterable[_T], value: _S) -> dict[_T, _S]
fromkeys(iterable: Iterable[_T], value: _S | None = None) -> dict[_T, _S] | dict[_T, Any | None]
Source code in src/omnipy/shared/protocols/builtins.py
@classmethod
def fromkeys(
    cls, iterable: Iterable[_T], value: _S | None = None, /) -> dict[_T, _S] | dict[_T, Any | None]: raise AssumedToBeImplementedException

get

get(key: _KT, default: None = None) -> _VT | None
get(key: _KT, default: _VT) -> _VT
get(key: _KT, default: _T) -> _VT | _T
get(key: _KT, default: None | _VT | _T = None) -> _VT | _T | None
Source code in src/omnipy/shared/protocols/builtins.py
def get(self, key: _KT, default: None | _VT | _T = None, /) -> _VT | _T | None: raise AssumedToBeImplementedException

items

items() -> IsDictItems[_KT, _VT]
Source code in src/omnipy/shared/protocols/builtins.py
def items(self) -> IsDictItems[_KT, _VT]: raise AssumedToBeImplementedException

keys

keys() -> IsDictKeys[_KT, _VT]
Source code in src/omnipy/shared/protocols/builtins.py
def keys(self) -> IsDictKeys[_KT, _VT]: raise AssumedToBeImplementedException

pop

pop(key: _KT) -> _VT
pop(key: _KT, default: _VT) -> _VT
pop(key: _KT, default: _T) -> _VT | _T
pop(key: _KT, default: None | _VT | _T = None) -> _VT | _T | None
Source code in src/omnipy/shared/protocols/builtins.py
def pop(self, key: _KT, default: None | _VT | _T = None, /) -> _VT | _T | None: raise AssumedToBeImplementedException

popitem

popitem() -> tuple[_KT, _VT]

D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.

Source code in src/omnipy/shared/protocols/typing.py
def popitem(self) -> tuple[_KT, _VT]:
    """
    D.popitem() -> (k, v), remove and return some (key, value) pair
       as a 2-tuple; but raise KeyError if D is empty.
    """
    raise AssumedToBeImplementedException

setdefault

setdefault(key: _KT, default: _VT) -> _VT

D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D

Source code in src/omnipy/shared/protocols/typing.py
def setdefault(self, key: _KT, default: _VT, /) -> _VT:
    """
    D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
    """
    raise AssumedToBeImplementedException

update

update(m: SupportsKeysAndGetItem[_KT, _VT]) -> None
update(m: SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> None
update(m: Iterable[tuple[_KT, _VT]]) -> None
update(m: Iterable[tuple[str, _VT]], /, **kwargs: _VT) -> None
update(**kwargs: _VT) -> None
update(
    m: SupportsKeysAndGetItem[_KT, _VT]
    | SupportsKeysAndGetItem[str, _VT]
    | Iterable[tuple[_KT, _VT]]
    | Iterable[tuple[str, _VT]]
    | None = None,
    /,
    **kwargs: _VT,
) -> None

D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

Source code in src/omnipy/shared/protocols/typing.py
def update(
    self,
    m: (SupportsKeysAndGetItem[_KT, _VT] | SupportsKeysAndGetItem[str, _VT]
        | Iterable[tuple[_KT, _VT]] | Iterable[tuple[str, _VT]] | None) = None,
    /,
    **kwargs: _VT,
) -> None:
    """
    D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
    If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
    If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
    In either case, this is followed by: for k, v in F.items(): D[k] = v
    """
    raise AssumedToBeImplementedException

values

values() -> IsDictValues[_KT, _VT]
Source code in src/omnipy/shared/protocols/builtins.py
def values(self) -> IsDictValues[_KT, _VT]: raise AssumedToBeImplementedException

IsFloat

Bases: Protocol

Protocol with the same interface as the builtin class float.

METHOD DESCRIPTION
as_integer_ratio
conjugate
from_number
fromhex
hex
is_integer
ATTRIBUTE DESCRIPTION
imag

TYPE: float

real

TYPE: float

Source code in src/omnipy/shared/protocols/builtins.py
class IsFloat(Protocol):
    """Protocol with the same interface as the builtin class `float`.
    """
    # def __new__(cls, x: ConvertibleToFloat = 0, /) -> Self: ...
    def as_integer_ratio(self) -> tuple[int, int]: raise AssumedToBeImplementedException
    def hex(self) -> str: raise AssumedToBeImplementedException
    def is_integer(self) -> bool: raise AssumedToBeImplementedException
    @classmethod
    def fromhex(cls, string: str, /) -> Self: raise AssumedToBeImplementedException
    @property
    def real(self) -> float: raise AssumedToBeImplementedException
    @property
    def imag(self) -> float: raise AssumedToBeImplementedException
    def conjugate(self) -> float: raise AssumedToBeImplementedException
    def __add__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __sub__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __mul__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __floordiv__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __truediv__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __mod__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __divmod__(self, value: float, /) -> tuple[float, float]: raise AssumedToBeImplementedException

    @overload
    def __pow__(self, value: int, mod: None = None, /) -> float: raise AssumedToBeImplementedException
    # positive __value -> float; negative __value -> complex
    # return type must be Any as `float | complex` causes too many false-positive errors
    @overload
    def __pow__(self, value: float, mod: None = None, /) -> Any: raise AssumedToBeImplementedException
    def __pow__(self, value: int | float, mod: None = None, /) -> Any: raise AssumedToBeImplementedException

    def __radd__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __rsub__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __rmul__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __rfloordiv__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __rtruediv__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __rmod__(self, value: float, /) -> float: raise AssumedToBeImplementedException
    def __rdivmod__(self, value: float, /) -> tuple[float, float]: raise AssumedToBeImplementedException

    @overload
    def __rpow__(self, value: _PositiveInteger, mod: None = None, /) -> float: raise AssumedToBeImplementedException
    @overload
    def __rpow__(self, value: _NegativeInteger, mod: None = None, /) -> complex: raise AssumedToBeImplementedException
    # Returning `complex` for the general case gives too many false-positive errors.
    @overload
    def __rpow__(self, value: float, mod: None = None, /) -> Any: raise AssumedToBeImplementedException
    def __rpow__(self, value: int | float, mod: None = None, /) -> Any: raise AssumedToBeImplementedException

    def __getnewargs__(self) -> tuple[float]: raise AssumedToBeImplementedException
    def __trunc__(self) -> int: raise AssumedToBeImplementedException
    def __ceil__(self) -> int: raise AssumedToBeImplementedException
    def __floor__(self) -> int: raise AssumedToBeImplementedException

    @overload
    def __round__(self, ndigits: None = None, /) -> int: raise AssumedToBeImplementedException
    @overload
    def __round__(self, ndigits: SupportsIndex, /) -> float: raise AssumedToBeImplementedException
    def __round__(self, ndigits: SupportsIndex | None = None, /) -> float | int: raise AssumedToBeImplementedException

    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __ne__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __lt__(self, value: float, /) -> bool: raise AssumedToBeImplementedException
    def __le__(self, value: float, /) -> bool: raise AssumedToBeImplementedException
    def __gt__(self, value: float, /) -> bool: raise AssumedToBeImplementedException
    def __ge__(self, value: float, /) -> bool: raise AssumedToBeImplementedException
    def __neg__(self) -> float: raise AssumedToBeImplementedException
    def __pos__(self) -> float: raise AssumedToBeImplementedException
    def __int__(self) -> int: raise AssumedToBeImplementedException
    def __float__(self) -> float: raise AssumedToBeImplementedException
    def __abs__(self) -> float: raise AssumedToBeImplementedException
    def __hash__(self) -> int: raise AssumedToBeImplementedException
    def __bool__(self) -> bool: raise AssumedToBeImplementedException
    def __format__(self, format_spec: str, /) -> str: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 14):
        @classmethod
        def from_number(cls, number: float | SupportsIndex | SupportsFloat, /) -> Self: raise AssumedToBeImplementedException

imag property

imag: float

real property

real: float

as_integer_ratio

as_integer_ratio() -> tuple[int, int]
Source code in src/omnipy/shared/protocols/builtins.py
def as_integer_ratio(self) -> tuple[int, int]: raise AssumedToBeImplementedException

conjugate

conjugate() -> float
Source code in src/omnipy/shared/protocols/builtins.py
def conjugate(self) -> float: raise AssumedToBeImplementedException

from_number classmethod

from_number(number: float | SupportsIndex | SupportsFloat) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
@classmethod
def from_number(cls, number: float | SupportsIndex | SupportsFloat, /) -> Self: raise AssumedToBeImplementedException

fromhex classmethod

fromhex(string: str) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
@classmethod
def fromhex(cls, string: str, /) -> Self: raise AssumedToBeImplementedException

hex

hex() -> str
Source code in src/omnipy/shared/protocols/builtins.py
def hex(self) -> str: raise AssumedToBeImplementedException

is_integer

is_integer() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def is_integer(self) -> bool: raise AssumedToBeImplementedException

IsFrozenSet

Bases: IsAbstractSet[_T_co], Protocol[_T_co]

Protocol with the same interface as the builtin class frozenset.

METHOD DESCRIPTION
difference
intersection
isdisjoint
issubset
issuperset
symmetric_difference
union
Source code in src/omnipy/shared/protocols/builtins.py
class IsFrozenSet(IsAbstractSet[_T_co], Protocol[_T_co]):  # type: ignore[misc]
    """Protocol with the same interface as the builtin class `frozenset`.
    """
    # @overload
    # def __new__(cls) -> Self:
    #     raise AssumedToBeImplementedException
    # @overload
    # def __new__(cls, iterable: Iterable[_T_co], /) -> Self:
    #     raise AssumedToBeImplementedException

    # def copy(self) -> frozenset[_T_co]: raise AssumedToBeImplementedException
    def difference(self, *s: Iterable[object]) -> frozenset[_T_co]: raise AssumedToBeImplementedException
    def intersection(self, *s: Iterable[object]) -> frozenset[_T_co]: raise AssumedToBeImplementedException
    def isdisjoint(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException
    def issubset(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException
    def issuperset(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException
    def symmetric_difference(self, s: Iterable[_S], /) -> frozenset[_T_co | _S]: raise AssumedToBeImplementedException
    def union(self, *s: Iterable[_S]) -> frozenset[_T_co | _S]: raise AssumedToBeImplementedException
    def __len__(self) -> int: raise AssumedToBeImplementedException
    def __contains__(self, o: object, /) -> bool: raise AssumedToBeImplementedException
    def __iter__(self) -> Iterator[_T_co]: raise AssumedToBeImplementedException
    def __and__(self, value: AbstractSet[object], /) -> frozenset[_T_co]: raise AssumedToBeImplementedException
    def __or__(self, value: AbstractSet[_S], /) -> frozenset[_T_co | _S]: raise AssumedToBeImplementedException
    def __sub__(self, value: AbstractSet[object], /) -> frozenset[_T_co]: raise AssumedToBeImplementedException
    def __xor__(self, value: AbstractSet[_S], /) -> frozenset[_T_co | _S]: raise AssumedToBeImplementedException
    def __le__(self, value: AbstractSet[object], /) -> bool: raise AssumedToBeImplementedException
    def __lt__(self, value: AbstractSet[object], /) -> bool: raise AssumedToBeImplementedException
    def __ge__(self, value: AbstractSet[object], /) -> bool: raise AssumedToBeImplementedException
    def __gt__(self, value: AbstractSet[object], /) -> bool: raise AssumedToBeImplementedException
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __hash__(self) -> int: raise AssumedToBeImplementedException

difference

difference(*s: Iterable[object]) -> frozenset[_T_co]
Source code in src/omnipy/shared/protocols/builtins.py
def difference(self, *s: Iterable[object]) -> frozenset[_T_co]: raise AssumedToBeImplementedException

intersection

intersection(*s: Iterable[object]) -> frozenset[_T_co]
Source code in src/omnipy/shared/protocols/builtins.py
def intersection(self, *s: Iterable[object]) -> frozenset[_T_co]: raise AssumedToBeImplementedException

isdisjoint

isdisjoint(s: Iterable[object]) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isdisjoint(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException

issubset

issubset(s: Iterable[object]) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def issubset(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException

issuperset

issuperset(s: Iterable[object]) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def issuperset(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException

symmetric_difference

symmetric_difference(s: Iterable[_S]) -> frozenset[_T_co | _S]
Source code in src/omnipy/shared/protocols/builtins.py
def symmetric_difference(self, s: Iterable[_S], /) -> frozenset[_T_co | _S]: raise AssumedToBeImplementedException

union

union(*s: Iterable[_S]) -> frozenset[_T_co | _S]
Source code in src/omnipy/shared/protocols/builtins.py
def union(self, *s: Iterable[_S]) -> frozenset[_T_co | _S]: raise AssumedToBeImplementedException

IsInt

Bases: Protocol

Protocol with the same interface as the builtin class int.

METHOD DESCRIPTION
as_integer_ratio
bit_count
bit_length
conjugate
from_bytes
is_integer
to_bytes
ATTRIBUTE DESCRIPTION
denominator

TYPE: Literal[1]

imag

TYPE: Literal[0]

numerator

TYPE: int

real

TYPE: int

Source code in src/omnipy/shared/protocols/builtins.py
class IsInt(Protocol):
    """Protocol with the same interface as the builtin class `int`.
    """

    # @overload
    # def __new__(cls, x: ConvertibleToInt = 0, /) -> Self: ...
    # @overload
    # def __new__(cls, x: str | bytes | bytearray, /, base: SupportsIndex) -> Self: ...

    def as_integer_ratio(self) -> tuple[int, Literal[1]]: raise AssumedToBeImplementedException
    @property
    def real(self) -> int: raise AssumedToBeImplementedException
    @property
    def imag(self) -> Literal[0]: raise AssumedToBeImplementedException
    @property
    def numerator(self) -> int: raise AssumedToBeImplementedException
    @property
    def denominator(self) -> Literal[1]: raise AssumedToBeImplementedException
    def conjugate(self) -> int: raise AssumedToBeImplementedException
    def bit_length(self) -> int: raise AssumedToBeImplementedException
    def bit_count(self) -> int: raise AssumedToBeImplementedException

    if sys.version_info >= (3, 11):
        def to_bytes(
            self, length: SupportsIndex = 1, byteorder: Literal["little", "big"] = "big", *, signed: bool = False
        ) -> bytes: raise AssumedToBeImplementedException
        @classmethod
        def from_bytes(
            cls,
            bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
            byteorder: Literal["little", "big"] = "big",
            *,
            signed: bool = False,
        ) -> Self: raise AssumedToBeImplementedException
    else:
        def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = False) -> bytes: raise AssumedToBeImplementedException
        @classmethod
        def from_bytes(
            cls,
            bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
            byteorder: Literal["little", "big"],
            *, 
            signed: bool = False,
        ) -> Self: raise AssumedToBeImplementedException

    if sys.version_info >= (3, 12):
        def is_integer(self) -> Literal[True]: raise AssumedToBeImplementedException

    def __add__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __sub__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __mul__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __floordiv__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __truediv__(self, value: int, /) -> float: raise AssumedToBeImplementedException
    def __mod__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __divmod__(self, value: int, /) -> tuple[int, int]: raise AssumedToBeImplementedException
    def __radd__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rsub__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rmul__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rfloordiv__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rtruediv__(self, value: int, /) -> float: raise AssumedToBeImplementedException
    def __rmod__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rdivmod__(self, value: int, /) -> tuple[int, int]: raise AssumedToBeImplementedException

    @overload
    def __pow__(self, x: Literal[0], /) -> Literal[1]: raise AssumedToBeImplementedException
    @overload
    def __pow__(self, value: Literal[0], mod: None, /) -> Literal[1]: raise AssumedToBeImplementedException
    @overload
    def __pow__(self, value: _PositiveInteger, mod: None = None, /) -> int: raise AssumedToBeImplementedException
    @overload
    def __pow__(self, value: _NegativeInteger, mod: None = None, /) -> float: raise AssumedToBeImplementedException
    # positive __value -> int; negative __value -> float
    # return type must be Any as `int | float` causes too many false-positive errors
    @overload
    def __pow__(self, value: int, mod: None = None, /) -> Any: raise AssumedToBeImplementedException
    @overload
    def __pow__(self, value: int, mod: int, /) -> int: raise AssumedToBeImplementedException
    def __pow__(self, value: int, mod: int | None = None, /) -> int | float: raise AssumedToBeImplementedException

    def __rpow__(self, value: int, mod: int | None = None, /) -> Any: raise AssumedToBeImplementedException
    def __and__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __or__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __xor__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __lshift__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rshift__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rand__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __ror__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rxor__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rlshift__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __rrshift__(self, value: int, /) -> int: raise AssumedToBeImplementedException
    def __neg__(self) -> int: raise AssumedToBeImplementedException
    def __pos__(self) -> int: raise AssumedToBeImplementedException
    def __invert__(self) -> int: raise AssumedToBeImplementedException
    def __trunc__(self) -> int: raise AssumedToBeImplementedException
    def __ceil__(self) -> int: raise AssumedToBeImplementedException
    def __floor__(self) -> int: raise AssumedToBeImplementedException
    if sys.version_info >= (3, 14):
        def __round__(self, ndigits: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException
    else:
        # def __round__(self, ndigits: SupportsIndex = ..., /) -> int:
        def __round__(self, ndigits: SupportsIndex = 0, /) -> int: raise AssumedToBeImplementedException

    def __getnewargs__(self) -> tuple[int]: raise AssumedToBeImplementedException
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __ne__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __lt__(self, value: int, /) -> bool: raise AssumedToBeImplementedException
    def __le__(self, value: int, /) -> bool: raise AssumedToBeImplementedException
    def __gt__(self, value: int, /) -> bool: raise AssumedToBeImplementedException
    def __ge__(self, value: int, /) -> bool: raise AssumedToBeImplementedException
    def __float__(self) -> float: raise AssumedToBeImplementedException
    def __int__(self) -> int: raise AssumedToBeImplementedException
    def __abs__(self) -> int: raise AssumedToBeImplementedException
    def __hash__(self) -> int: raise AssumedToBeImplementedException
    def __bool__(self) -> bool: raise AssumedToBeImplementedException
    def __index__(self) -> int: raise AssumedToBeImplementedException
    def __format__(self, format_spec: str, /) -> str: raise AssumedToBeImplementedException

denominator property

denominator: Literal[1]

imag property

imag: Literal[0]

numerator property

numerator: int

real property

real: int

as_integer_ratio

as_integer_ratio() -> tuple[int, Literal[1]]
Source code in src/omnipy/shared/protocols/builtins.py
def as_integer_ratio(self) -> tuple[int, Literal[1]]: raise AssumedToBeImplementedException

bit_count

bit_count() -> int
Source code in src/omnipy/shared/protocols/builtins.py
def bit_count(self) -> int: raise AssumedToBeImplementedException

bit_length

bit_length() -> int
Source code in src/omnipy/shared/protocols/builtins.py
def bit_length(self) -> int: raise AssumedToBeImplementedException

conjugate

conjugate() -> int
Source code in src/omnipy/shared/protocols/builtins.py
def conjugate(self) -> int: raise AssumedToBeImplementedException

from_bytes classmethod

from_bytes(
    bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
    byteorder: Literal["little", "big"],
    *,
    signed: bool = False,
) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
@classmethod
def from_bytes(
    cls,
    bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
    byteorder: Literal["little", "big"],
    *, 
    signed: bool = False,
) -> Self: raise AssumedToBeImplementedException

is_integer

is_integer() -> Literal[True]
Source code in src/omnipy/shared/protocols/builtins.py
def is_integer(self) -> Literal[True]: raise AssumedToBeImplementedException

to_bytes

to_bytes(
    length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = False
) -> bytes
Source code in src/omnipy/shared/protocols/builtins.py
def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = False) -> bytes: raise AssumedToBeImplementedException

IsList

Bases: IsMutableSequence[_T], Protocol[_T]

Protocol with the same interface as the builtin class list.

METHOD DESCRIPTION
append
clear

S.clear() -> None -- remove all items from S

count
extend
index
insert
pop
remove
reverse

S.reverse() -- reverse IN PLACE

sort
Source code in src/omnipy/shared/protocols/builtins.py
class IsList(IsMutableSequence[_T], Protocol[_T]):
    """Protocol with the same interface as the builtin class `list`.
    """

    # @overload
    # def __init__(self) -> None: ...
    # @overload
    # def __init__(self, iterable: Iterable[_T], /) -> None: ...

    # def copy(self) -> list[_T]: raise AssumedToBeImplementedException
    def append(self, object: _T, /) -> None: raise AssumedToBeImplementedException
    def extend(self, iterable: Iterable[_T], /) -> None: raise AssumedToBeImplementedException
    def pop(self, index: SupportsIndex = -1, /) -> _T: raise AssumedToBeImplementedException
    # Signature of `list.index` should be kept in line with `collections.UserList.index()`
    # and multiprocessing.managers.ListProxy.index()
    def index(self, value: _T, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize, /) -> int: raise AssumedToBeImplementedException
    def count(self, value: _T, /) -> int: raise AssumedToBeImplementedException
    def insert(self, index: SupportsIndex, object: _T, /) -> None: raise AssumedToBeImplementedException
    def remove(self, value: _T, /) -> None: raise AssumedToBeImplementedException

    # Signature of `list.sort` should be kept inline with `collections.UserList.sort()`
    # and multiprocessing.managers.ListProxy.sort()
    #
    # Use list[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison]
    # to work around invariance
    @overload
    def sort(self: IsList[SupportsRichComparisonT], *, key: None = None, reverse: bool = False) -> None: raise AssumedToBeImplementedException
    @overload
    def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> None: raise AssumedToBeImplementedException
    def sort(self: IsList[_T] | IsList[SupportsRichComparisonT], *, key: Callable[[_T], SupportsRichComparison] | None = None, reverse: bool = False) -> None: raise AssumedToBeImplementedException

    def __len__(self) -> int: raise AssumedToBeImplementedException
    def __iter__(self) -> Iterator[_T]: raise AssumedToBeImplementedException
    # __hash__: ClassVar[None]  # type: ignore[assignment]
    __hash__: ClassVar[None] = None  # type: ignore[assignment]

    @overload
    def __getitem__(self, i: SupportsIndex, /) -> _T: raise AssumedToBeImplementedException
    @overload
    # def __getitem__(self, s: slice[SupportsIndex | None], /) -> list[_T]: ...
    def __getitem__(self, s: slice, /) -> list[_T]: raise AssumedToBeImplementedException
    def __getitem__(self, s: slice | SupportsIndex, /) -> list[_T] | _T: raise AssumedToBeImplementedException

    @overload
    def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: raise AssumedToBeImplementedException
    @overload
    # def __setitem__(self, key: slice[SupportsIndex | None], value: Iterable[_T], /) -> None: ...
    def __setitem__(self, key: slice, value: Iterable[_T], /) -> None: raise AssumedToBeImplementedException
    def __setitem__(self, key: slice | SupportsIndex, value: Iterable[_T] | _T, /) -> None: raise AssumedToBeImplementedException

    # def __delitem__(self, key: SupportsIndex | slice[SupportsIndex | None], /) -> None: ...
    def __delitem__(self, key: SupportsIndex | slice, /) -> None: raise AssumedToBeImplementedException

    # Overloading looks unnecessary, but is needed to work around complex mypy problems
    @overload
    def __add__(self, value: list[_T], /) -> list[_T]: raise AssumedToBeImplementedException
    @overload
    def __add__(self, value: list[_S], /) -> list[_S | _T]: raise AssumedToBeImplementedException
    def __add__(self, value: list[Any], /) -> list[Any]: raise AssumedToBeImplementedException

    def __iadd__(self, value: Iterable[_T], /) -> Self: raise AssumedToBeImplementedException
    def __mul__(self, value: SupportsIndex, /) -> list[_T]: raise AssumedToBeImplementedException
    def __rmul__(self, value: SupportsIndex, /) -> list[_T]: raise AssumedToBeImplementedException
    def __imul__(self, value: SupportsIndex, /) -> Self: raise AssumedToBeImplementedException
    def __contains__(self, key: object, /) -> bool: raise AssumedToBeImplementedException
    def __reversed__(self) -> Iterator[_T]: raise AssumedToBeImplementedException
    def __gt__(self, value: list[_T], /) -> bool: raise AssumedToBeImplementedException
    def __ge__(self, value: list[_T], /) -> bool: raise AssumedToBeImplementedException
    def __lt__(self, value: list[_T], /) -> bool: raise AssumedToBeImplementedException
    def __le__(self, value: list[_T], /) -> bool: raise AssumedToBeImplementedException
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException

append

append(object: _T) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def append(self, object: _T, /) -> None: raise AssumedToBeImplementedException

clear

clear() -> None

S.clear() -> None -- remove all items from S

Source code in src/omnipy/shared/protocols/typing.py
def clear(self) -> None:
    """
    S.clear() -> None -- remove all items from S
    """
    raise AssumedToBeImplementedException

count

count(value: _T) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def count(self, value: _T, /) -> int: raise AssumedToBeImplementedException

extend

extend(iterable: Iterable[_T]) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def extend(self, iterable: Iterable[_T], /) -> None: raise AssumedToBeImplementedException

index

index(value: _T, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def index(self, value: _T, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize, /) -> int: raise AssumedToBeImplementedException

insert

insert(index: SupportsIndex, object: _T) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def insert(self, index: SupportsIndex, object: _T, /) -> None: raise AssumedToBeImplementedException

pop

pop(index: SupportsIndex = -1) -> _T
Source code in src/omnipy/shared/protocols/builtins.py
def pop(self, index: SupportsIndex = -1, /) -> _T: raise AssumedToBeImplementedException

remove

remove(value: _T) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def remove(self, value: _T, /) -> None: raise AssumedToBeImplementedException

reverse

reverse() -> None

S.reverse() -- reverse IN PLACE

Source code in src/omnipy/shared/protocols/typing.py
def reverse(self) -> None:
    """
    S.reverse() -- reverse *IN PLACE*
    """
    raise AssumedToBeImplementedException

sort

sort(*, key: None = None, reverse: bool = False) -> None
sort(*, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> None
sort(*, key: Callable[[_T], SupportsRichComparison] | None = None, reverse: bool = False) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def sort(self: IsList[_T] | IsList[SupportsRichComparisonT], *, key: Callable[[_T], SupportsRichComparison] | None = None, reverse: bool = False) -> None: raise AssumedToBeImplementedException

IsSet

Bases: IsMutableSet[_T], Protocol[_T]

Protocol with the same interface as the builtin class set.

METHOD DESCRIPTION
add
clear
difference
difference_update
discard
intersection
intersection_update
isdisjoint
issubset
issuperset
pop
remove
symmetric_difference
symmetric_difference_update
union
update
Source code in src/omnipy/shared/protocols/builtins.py
class IsSet(IsMutableSet[_T], Protocol[_T]):
    """Protocol with the same interface as the builtin class `set`.
    """
    # @overload
    # def __init__(self) -> None: ...
    #
    # @overload
    # def __init__(self, iterable: Iterable[_T], /) -> None: ...

    def add(self, element: _T, /) -> None: raise AssumedToBeImplementedException
    # def copy(self) -> set[_T]: raise AssumedToBeImplementedException
    def difference(self, *s: Iterable[object]) -> set[_T]: raise AssumedToBeImplementedException
    def difference_update(self, *s: Iterable[object]) -> None: raise AssumedToBeImplementedException
    def discard(self, element: object, /) -> None: raise AssumedToBeImplementedException
    def intersection(self, *s: Iterable[object]) -> set[_T]: raise AssumedToBeImplementedException
    def intersection_update(self, *s: Iterable[object]) -> None: raise AssumedToBeImplementedException
    def isdisjoint(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException
    def issubset(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException
    def issuperset(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException
    def remove(self, element: _T, /) -> None: raise AssumedToBeImplementedException
    def symmetric_difference(self, s: Iterable[_S], /) -> set[_T | _S]: raise AssumedToBeImplementedException
    def symmetric_difference_update(self, s: Iterable[_T], /) -> None: raise AssumedToBeImplementedException
    def union(self, *s: Iterable[_S]) -> set[_T | _S]: raise AssumedToBeImplementedException
    def update(self, *s: Iterable[_T]) -> None: raise AssumedToBeImplementedException
    def __len__(self) -> int: raise AssumedToBeImplementedException
    def __contains__(self, o: object, /) -> bool: raise AssumedToBeImplementedException
    def __iter__(self) -> Iterator[_T]: raise AssumedToBeImplementedException
    def __and__(self, value: AbstractSet[object], /) -> set[_T]: raise AssumedToBeImplementedException
    def __iand__(self, value: AbstractSet[object], /) -> set[_T]: raise AssumedToBeImplementedException
    def __or__(self, value: AbstractSet[_S], /) -> set[_T | _S]: raise AssumedToBeImplementedException
    def __ior__(self, value: AbstractSet[_T], /) -> Self: raise AssumedToBeImplementedException
    def __sub__(self, value: AbstractSet[object], /) -> set[_T]: raise AssumedToBeImplementedException
    def __isub__(self, value: AbstractSet[object], /) -> Self: raise AssumedToBeImplementedException
    def __xor__(self, value: AbstractSet[_S], /) -> set[_T | _S]: raise AssumedToBeImplementedException
    def __ixor__(self, value: AbstractSet[_T], /) -> Self: raise AssumedToBeImplementedException
    def __le__(self, value: AbstractSet[object], /) -> bool: raise AssumedToBeImplementedException
    def __lt__(self, value: AbstractSet[object], /) -> bool: raise AssumedToBeImplementedException
    def __ge__(self, value: AbstractSet[object], /) -> bool: raise AssumedToBeImplementedException
    def __gt__(self, value: AbstractSet[object], /) -> bool: raise AssumedToBeImplementedException
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    __hash__: ClassVar[None] = None  # type: ignore[assignment]

add

add(element: _T) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def add(self, element: _T, /) -> None: raise AssumedToBeImplementedException

clear

clear() -> None
Source code in src/omnipy/shared/protocols/typing.py
def clear(self) -> None: raise AssumedToBeImplementedException

difference

difference(*s: Iterable[object]) -> set[_T]
Source code in src/omnipy/shared/protocols/builtins.py
def difference(self, *s: Iterable[object]) -> set[_T]: raise AssumedToBeImplementedException

difference_update

difference_update(*s: Iterable[object]) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def difference_update(self, *s: Iterable[object]) -> None: raise AssumedToBeImplementedException

discard

discard(element: object) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def discard(self, element: object, /) -> None: raise AssumedToBeImplementedException

intersection

intersection(*s: Iterable[object]) -> set[_T]
Source code in src/omnipy/shared/protocols/builtins.py
def intersection(self, *s: Iterable[object]) -> set[_T]: raise AssumedToBeImplementedException

intersection_update

intersection_update(*s: Iterable[object]) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def intersection_update(self, *s: Iterable[object]) -> None: raise AssumedToBeImplementedException

isdisjoint

isdisjoint(s: Iterable[object]) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isdisjoint(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException

issubset

issubset(s: Iterable[object]) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def issubset(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException

issuperset

issuperset(s: Iterable[object]) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def issuperset(self, s: Iterable[object], /) -> bool: raise AssumedToBeImplementedException

pop

pop() -> _T
Source code in src/omnipy/shared/protocols/typing.py
def pop(self) -> _T: raise AssumedToBeImplementedException

remove

remove(element: _T) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def remove(self, element: _T, /) -> None: raise AssumedToBeImplementedException

symmetric_difference

symmetric_difference(s: Iterable[_S]) -> set[_T | _S]
Source code in src/omnipy/shared/protocols/builtins.py
def symmetric_difference(self, s: Iterable[_S], /) -> set[_T | _S]: raise AssumedToBeImplementedException

symmetric_difference_update

symmetric_difference_update(s: Iterable[_T]) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def symmetric_difference_update(self, s: Iterable[_T], /) -> None: raise AssumedToBeImplementedException

union

union(*s: Iterable[_S]) -> set[_T | _S]
Source code in src/omnipy/shared/protocols/builtins.py
def union(self, *s: Iterable[_S]) -> set[_T | _S]: raise AssumedToBeImplementedException

update

update(*s: Iterable[_T]) -> None
Source code in src/omnipy/shared/protocols/builtins.py
def update(self, *s: Iterable[_T]) -> None: raise AssumedToBeImplementedException

IsStr

Bases: IsItemSequence[str], Protocol

Protocol with the same interface as the builtin class str.

METHOD DESCRIPTION
capitalize
casefold
center
count
encode
endswith
expandtabs
find
format
format_map
index
isalnum
isalpha
isascii
isdecimal
isdigit
isidentifier
islower
isnumeric
isprintable
isspace
istitle
isupper
join
ljust
lower
lstrip
maketrans
partition
removeprefix
removesuffix
replace
rfind
rindex
rjust
rpartition
rsplit
rstrip
split
splitlines
startswith
strip
swapcase
title
translate
upper
zfill
Source code in src/omnipy/shared/protocols/builtins.py
class IsStr(IsItemSequence[str], Protocol):
    """Protocol with the same interface as the builtin class `str`.
    """
    # @overload
    # def __new__(cls, object: object = "") -> Self: ...
    # @overload
    # def __new__(cls, object: ReadableBuffer, encoding: str = "utf-8", errors: str = "strict") -> Self: ...

    @overload
    def capitalize(self: LiteralString) -> LiteralString: raise AssumedToBeImplementedException  # type: ignore [misc]
    @overload
    # def capitalize(self) -> str: ...  # type: ignore[misc]
    def capitalize(self) -> Self: raise AssumedToBeImplementedException
    def capitalize(self) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def casefold(self: LiteralString) -> LiteralString: raise AssumedToBeImplementedException  # type: ignore [misc]
    @overload
    # def casefold(self) -> str: ...  # type: ignore[misc]
    def casefold(self) -> Self: raise AssumedToBeImplementedException
    def casefold(self) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def center(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def center(self, width: SupportsIndex, fillchar: str = " ", /) -> str: ...  # type: ignore[misc]
    def center(self, width: SupportsIndex, fillchar: str = " ", /) -> Self: raise AssumedToBeImplementedException  # type: ignore[misc]
    def center(self, width: SupportsIndex, fillchar: str | LiteralString = ' ', /) -> Self | LiteralString: raise AssumedToBeImplementedException

    def count(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException
    def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: raise AssumedToBeImplementedException
    def endswith(
        self, suffix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> bool: raise AssumedToBeImplementedException

    @overload
    def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ...  # type: ignore[misc]
    def expandtabs(self, tabsize: SupportsIndex = 8) -> Self: raise AssumedToBeImplementedException
    def expandtabs(self, tabsize: SupportsIndex = 8) -> Self | LiteralString: raise AssumedToBeImplementedException

    def find(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException

    @overload
    def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def format(self, *args: object, **kwargs: object) -> str: ...
    def format(self, *args: object, **kwargs: object) -> Self: raise AssumedToBeImplementedException
    def format(self, *args: object | LiteralString, **kwargs: object | LiteralString) -> Self | LiteralString: raise AssumedToBeImplementedException

    # def format_map(self, mapping: _FormatMapMapping, /) -> str: ...
    def format_map(self, mapping: _FormatMapMapping, /) -> Self: raise AssumedToBeImplementedException

    def index(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException
    def isalnum(self) -> bool: raise AssumedToBeImplementedException
    def isalpha(self) -> bool: raise AssumedToBeImplementedException
    def isascii(self) -> bool: raise AssumedToBeImplementedException
    def isdecimal(self) -> bool: raise AssumedToBeImplementedException
    def isdigit(self) -> bool: raise AssumedToBeImplementedException
    def isidentifier(self) -> bool: raise AssumedToBeImplementedException
    def islower(self) -> bool: raise AssumedToBeImplementedException
    def isnumeric(self) -> bool: raise AssumedToBeImplementedException
    def isprintable(self) -> bool: raise AssumedToBeImplementedException
    def isspace(self) -> bool: raise AssumedToBeImplementedException
    def istitle(self) -> bool: raise AssumedToBeImplementedException
    def isupper(self) -> bool: raise AssumedToBeImplementedException

    @overload
    def join(self: LiteralString, iterable: Iterable[LiteralString], /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def join(self, iterable: Iterable[str], /) -> str: ...  # type: ignore[misc]
    def join(self, iterable: Iterable[str], /) -> Self: raise AssumedToBeImplementedException
    def join(self, iterable: Iterable[str] | Iterable[LiteralString], /) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def ljust(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ...
    @overload
    # def ljust(self, width: SupportsIndex, fillchar: str = " ", /) -> str: ...  # type: ignore[misc]
    def ljust(self, width: SupportsIndex, fillchar: str = " ", /) -> Self: raise AssumedToBeImplementedException
    def ljust(self, width: SupportsIndex, fillchar: str | LiteralString = ' ', /) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def lower(self: LiteralString) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def lower(self) -> str: ...  # type: ignore[misc]
    def lower(self) -> Self: raise AssumedToBeImplementedException
    def lower(self) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def lstrip(self: LiteralString, chars: LiteralString | None = None, /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def lstrip(self, chars: str | None = None, /) -> str: ...  # type: ignore[misc]
    def lstrip(self, chars: str | None = None, /) -> Self: raise AssumedToBeImplementedException
    def lstrip(self, chars: str | LiteralString | None = None, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def partition(self: LiteralString, sep: LiteralString, /) -> tuple[LiteralString, LiteralString, LiteralString]: raise AssumedToBeImplementedException
    @overload
    # def partition(self, sep: str, /) -> tuple[str, str, str]: ...  # type: ignore[misc]
    def partition(self, sep: str, /) -> tuple[Self, Self, Self]: raise AssumedToBeImplementedException
    def partition(self, sep: str | LiteralString, /) -> tuple[Self, Self, Self] | tuple[LiteralString, LiteralString, LiteralString]: raise AssumedToBeImplementedException

    if sys.version_info >= (3, 13):
        @overload
        def replace(
            self: LiteralString, old: LiteralString, new: LiteralString, /, count: SupportsIndex = -1
        ) -> LiteralString: ...
        @overload
        # def replace(self, old: str, new: str, /, count: SupportsIndex = -1) -> str: ...  # type: ignore[misc]
        def replace(self, old: str, new: str, /, count: SupportsIndex = -1) -> Self: raise AssumedToBeImplementedException  # type: ignore[misc]
        def replace(self, old: str | LiteralString, new: str | LiteralString, /, count: SupportsIndex = -1) -> Self | LiteralString: raise AssumedToBeImplementedException
    else:
        @overload
        def replace(
            self: LiteralString, old: LiteralString, new: LiteralString, count: SupportsIndex = -1, /
        ) -> LiteralString: raise AssumedToBeImplementedException
        @overload
        # def replace(self, old: str, new: str, count: SupportsIndex = -1, /) -> str:
        def replace(self, old: str, new: str, count: SupportsIndex = -1, /) -> Self: raise AssumedToBeImplementedException
        def replace(self, old: str | LiteralString, new: str | LiteralString, count: SupportsIndex = -1, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def removeprefix(self: LiteralString, prefix: LiteralString, /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def removeprefix(self, prefix: str, /) -> str:
    def removeprefix(self, prefix: str, /) -> Self: raise AssumedToBeImplementedException
    def removeprefix(self, prefix: str | LiteralString, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def removesuffix(self: LiteralString, suffix: LiteralString, /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def removesuffix(self, suffix: str, /) -> str:
    def removesuffix(self, suffix: str, /) -> Self: raise AssumedToBeImplementedException
    def removesuffix(self, suffix: str | LiteralString, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    def rfind(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException
    def rindex(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException

    @overload
    def rjust(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def rjust(self, width: SupportsIndex, fillchar: str = " ", /) -> str:
    def rjust(self, width: SupportsIndex, fillchar: str = ' ', /) -> Self: raise AssumedToBeImplementedException
    def rjust(self, width: SupportsIndex, fillchar: str | LiteralString = " ", /) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def rpartition(self: LiteralString, sep: LiteralString, /) -> tuple[LiteralString, LiteralString, LiteralString]: raise AssumedToBeImplementedException
    @overload
    # def rpartition(self, sep: str, /) -> tuple[str, str, str]:
    def rpartition(self, sep: str, /) -> tuple[Self, Self, Self]: raise AssumedToBeImplementedException
    def rpartition(self, sep: str | LiteralString, /) -> tuple[Self, Self, Self] | tuple[LiteralString, LiteralString, LiteralString]: raise AssumedToBeImplementedException

    @overload
    def rsplit(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: raise AssumedToBeImplementedException
    @overload
    # def rsplit(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]:
    def rsplit(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[Self]: raise AssumedToBeImplementedException
    def rsplit(self, sep: str | LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[Self] | list[LiteralString]: raise AssumedToBeImplementedException

    @overload
    def rstrip(self: LiteralString, chars: LiteralString | None = None, /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def rstrip(self, chars: str | None = None, /) -> str: ...
    def rstrip(self, chars: str | None = None, /) -> Self: raise AssumedToBeImplementedException
    def rstrip(self, chars: str | None = None, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def split(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: raise AssumedToBeImplementedException
    @overload
    # def split(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]:
    def split(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[Self]: raise AssumedToBeImplementedException
    def split(self, sep: str | LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[Self] | list[LiteralString]: raise AssumedToBeImplementedException

    @overload
    def splitlines(self: LiteralString, keepends: bool = False) -> list[LiteralString]: raise AssumedToBeImplementedException
    @overload
    # def splitlines(self, keepends: bool = False) -> list[str]:
    def splitlines(self, keepends: bool = False) -> list[Self]: raise AssumedToBeImplementedException
    def splitlines(self, keepends: bool = False) -> list[Self] | list[LiteralString]: raise AssumedToBeImplementedException

    def startswith(
        self, prefix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
    ) -> bool: raise AssumedToBeImplementedException

    @overload
    def strip(  # type: ignore[misc]
        self: LiteralString, chars: LiteralString | None = None, /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def strip(self, chars: str | None = None, /) -> str:
    def strip(self, chars: str | None = None, /) -> Self: raise AssumedToBeImplementedException
    def strip(self, chars: str | LiteralString | None = None, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def swapcase(self: LiteralString) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def swapcase(self) -> str: ...  # type: ignore[misc]
    def swapcase(self) -> Self: raise AssumedToBeImplementedException
    def swapcase(self) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def title(self: LiteralString) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def title(self) -> str: ...  # type: ignore[misc]
    def title(self) -> Self: raise AssumedToBeImplementedException
    def title(self) -> Self | LiteralString: raise AssumedToBeImplementedException

    # def translate(self, table: _TranslateTable, /) -> str: ...
    def translate(self, table: _TranslateTable, /) -> Self: raise AssumedToBeImplementedException

    @overload
    def upper(self: LiteralString) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def upper(self) -> str: ...  # type: ignore[misc]
    def upper(self) -> Self: raise AssumedToBeImplementedException
    def upper(self) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def zfill(self: LiteralString, width: SupportsIndex, /) -> LiteralString: raise AssumedToBeImplementedException

    @overload
    # def zfill(self, width: SupportsIndex, /) -> str: ...  # type: ignore[misc]
    def zfill(self, width: SupportsIndex, /) -> Self: raise AssumedToBeImplementedException
    def zfill(self, width: SupportsIndex, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    if sys.version_info >= (3, 15):
        @staticmethod
        @overload
        def maketrans(
            x: (
                dict[int, _T]
                | dict[str, _T]
                | dict[str | int, _T]
                | frozendict[int, _T]
                | frozendict[str, _T]
                | frozendict[str | int, _T]
            ),
            /,
        ) -> dict[int, _T]: raise AssumedToBeImplementedException
    else:
        @staticmethod
        @overload
        def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T], /) -> dict[int, _T]: raise AssumedToBeImplementedException

    @staticmethod
    @overload
    def maketrans(x: str, y: str, /) -> dict[int, int]: raise AssumedToBeImplementedException
    @staticmethod
    @overload
    def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: raise AssumedToBeImplementedException
    @staticmethod
    def maketrans(x: str | dict[int, _T] | dict[str, _T] | dict[str | int, _T], y: str | None = None, z: str | None = None, /) -> dict[int, _T] | dict[int, int] | dict[int, int | None]: raise AssumedToBeImplementedException

    @overload
    def __add__(self: LiteralString, value: LiteralString, /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def __add__(self, value: str, /) -> str: ...   # type: ignore[misc]
    def __add__(self, value: str, /) -> Self: raise AssumedToBeImplementedException
    def __add__(self, value: str | LiteralString, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    # Incompatible with Sequence.__contains__
    def __contains__(self, key: str, /) -> bool: raise AssumedToBeImplementedException
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __ge__(self, value: str, /) -> bool: raise AssumedToBeImplementedException

    @overload
    # def __getitem__(self: LiteralString, key: SupportsIndex | slice[SupportsIndex | None], /) -> LiteralString: ...
    def __getitem__(self: LiteralString, key: SupportsIndex | slice, /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def __getitem__(self, key: SupportsIndex | slice[SupportsIndex | None], /) -> str:
    def __getitem__(self, key: SupportsIndex | slice, /) -> Self: raise AssumedToBeImplementedException
    def __getitem__(self, key: SupportsIndex | slice, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    def __gt__(self, value: str, /) -> bool: raise AssumedToBeImplementedException
    def __hash__(self) -> int: raise AssumedToBeImplementedException

    @overload
    def __iter__(self: LiteralString) -> Iterator[LiteralString]: raise AssumedToBeImplementedException
    @overload
    # def __iter__(self) -> Iterator[str]: ...  # type: ignore[misc]
    def __iter__(self) -> Iterator[Self]: raise AssumedToBeImplementedException
    def __iter__(self) -> Iterator[Self] | Iterator[LiteralString]: raise AssumedToBeImplementedException

    def __le__(self, value: str, /) -> bool: raise AssumedToBeImplementedException
    def __len__(self) -> int: raise AssumedToBeImplementedException
    def __lt__(self, value: str, /) -> bool: raise AssumedToBeImplementedException

    @overload
    def __mod__(self: LiteralString, value: LiteralString | tuple[LiteralString, ...], /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def __mod__(self, value: Any, /) -> str: ...
    def __mod__(self, value: Any, /) -> Self: raise AssumedToBeImplementedException
    def __mod__(self, value: Any, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    @overload
    def __mul__(self: LiteralString, value: SupportsIndex, /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def __mul__(self, value: SupportsIndex, /) -> str: ...  # type: ignore[misc]
    def __mul__(self, value: SupportsIndex, /) -> Self: raise AssumedToBeImplementedException
    def __mul__(self, value: SupportsIndex, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    def __ne__(self, value: object, /) -> bool: raise AssumedToBeImplementedException

    @overload
    def __rmul__(self: LiteralString, value: SupportsIndex, /) -> LiteralString: raise AssumedToBeImplementedException
    @overload
    # def __rmul__(self, value: SupportsIndex, /) -> str: ...  # type: ignore[misc]
    def __rmul__(self, value: SupportsIndex, /) -> Self: raise AssumedToBeImplementedException
    def __rmul__(self, value: SupportsIndex, /) -> Self | LiteralString: raise AssumedToBeImplementedException

    def __getnewargs__(self) -> tuple[str]: raise AssumedToBeImplementedException
    # def __format__(self, format_spec: str, /) -> str:
    def __format__(self, format_spec: str, /) -> Self:  # type: ignore [override]
        raise AssumedToBeImplementedException

capitalize

capitalize() -> LiteralString
capitalize() -> Self
capitalize() -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def capitalize(self) -> Self | LiteralString: raise AssumedToBeImplementedException

casefold

casefold() -> LiteralString
casefold() -> Self
casefold() -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def casefold(self) -> Self | LiteralString: raise AssumedToBeImplementedException

center

center(width: SupportsIndex, fillchar: LiteralString = ' ') -> LiteralString
center(width: SupportsIndex, fillchar: str = ' ') -> Self
center(width: SupportsIndex, fillchar: str | LiteralString = ' ') -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def center(self, width: SupportsIndex, fillchar: str | LiteralString = ' ', /) -> Self | LiteralString: raise AssumedToBeImplementedException

count

count(sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def count(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException

encode

encode(encoding: str = 'utf-8', errors: str = 'strict') -> bytes
Source code in src/omnipy/shared/protocols/builtins.py
def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: raise AssumedToBeImplementedException

endswith

endswith(
    suffix: str | tuple[str, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def endswith(
    self, suffix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> bool: raise AssumedToBeImplementedException

expandtabs

expandtabs(tabsize: SupportsIndex = 8) -> LiteralString
expandtabs(tabsize: SupportsIndex = 8) -> Self
expandtabs(tabsize: SupportsIndex = 8) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def expandtabs(self, tabsize: SupportsIndex = 8) -> Self | LiteralString: raise AssumedToBeImplementedException

find

find(sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def find(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException

format

format(*args: LiteralString, **kwargs: LiteralString) -> LiteralString
format(*args: object, **kwargs: object) -> Self
format(*args: object | LiteralString, **kwargs: object | LiteralString) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def format(self, *args: object | LiteralString, **kwargs: object | LiteralString) -> Self | LiteralString: raise AssumedToBeImplementedException

format_map

format_map(mapping: _FormatMapMapping) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def format_map(self, mapping: _FormatMapMapping, /) -> Self: raise AssumedToBeImplementedException

index

index(sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def index(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException

isalnum

isalnum() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isalnum(self) -> bool: raise AssumedToBeImplementedException

isalpha

isalpha() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isalpha(self) -> bool: raise AssumedToBeImplementedException

isascii

isascii() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isascii(self) -> bool: raise AssumedToBeImplementedException

isdecimal

isdecimal() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isdecimal(self) -> bool: raise AssumedToBeImplementedException

isdigit

isdigit() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isdigit(self) -> bool: raise AssumedToBeImplementedException

isidentifier

isidentifier() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isidentifier(self) -> bool: raise AssumedToBeImplementedException

islower

islower() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def islower(self) -> bool: raise AssumedToBeImplementedException

isnumeric

isnumeric() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isnumeric(self) -> bool: raise AssumedToBeImplementedException

isprintable

isprintable() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isprintable(self) -> bool: raise AssumedToBeImplementedException

isspace

isspace() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isspace(self) -> bool: raise AssumedToBeImplementedException

istitle

istitle() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def istitle(self) -> bool: raise AssumedToBeImplementedException

isupper

isupper() -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def isupper(self) -> bool: raise AssumedToBeImplementedException

join

join(iterable: Iterable[LiteralString]) -> LiteralString
join(iterable: Iterable[str]) -> Self
join(iterable: Iterable[str] | Iterable[LiteralString]) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def join(self, iterable: Iterable[str] | Iterable[LiteralString], /) -> Self | LiteralString: raise AssumedToBeImplementedException

ljust

ljust(width: SupportsIndex, fillchar: LiteralString = ' ') -> LiteralString
ljust(width: SupportsIndex, fillchar: str = ' ') -> Self
ljust(width: SupportsIndex, fillchar: str | LiteralString = ' ') -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def ljust(self, width: SupportsIndex, fillchar: str | LiteralString = ' ', /) -> Self | LiteralString: raise AssumedToBeImplementedException

lower

lower() -> LiteralString
lower() -> Self
lower() -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def lower(self) -> Self | LiteralString: raise AssumedToBeImplementedException

lstrip

lstrip(chars: LiteralString | None = None) -> LiteralString
lstrip(chars: str | None = None) -> Self
lstrip(chars: str | LiteralString | None = None) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def lstrip(self, chars: str | LiteralString | None = None, /) -> Self | LiteralString: raise AssumedToBeImplementedException

maketrans staticmethod

maketrans(
    x: dict[int, _T]
    | dict[str, _T]
    | dict[str | int, _T]
    | frozendict[int, _T]
    | frozendict[str, _T]
    | frozendict[str | int, _T],
) -> dict[int, _T]
maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]
maketrans(x: str, y: str) -> dict[int, int]
maketrans(x: str, y: str, z: str) -> dict[int, int | None]
maketrans(
    x: str | dict[int, _T] | dict[str, _T] | dict[str | int, _T],
    y: str | None = None,
    z: str | None = None,
) -> dict[int, _T] | dict[int, int] | dict[int, int | None]
Source code in src/omnipy/shared/protocols/builtins.py
@staticmethod
def maketrans(x: str | dict[int, _T] | dict[str, _T] | dict[str | int, _T], y: str | None = None, z: str | None = None, /) -> dict[int, _T] | dict[int, int] | dict[int, int | None]: raise AssumedToBeImplementedException

partition

partition(sep: LiteralString) -> tuple[LiteralString, LiteralString, LiteralString]
partition(sep: str) -> tuple[Self, Self, Self]
partition(
    sep: str | LiteralString,
) -> tuple[Self, Self, Self] | tuple[LiteralString, LiteralString, LiteralString]
Source code in src/omnipy/shared/protocols/builtins.py
def partition(self, sep: str | LiteralString, /) -> tuple[Self, Self, Self] | tuple[LiteralString, LiteralString, LiteralString]: raise AssumedToBeImplementedException

removeprefix

removeprefix(prefix: LiteralString) -> LiteralString
removeprefix(prefix: str) -> Self
removeprefix(prefix: str | LiteralString) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def removeprefix(self, prefix: str | LiteralString, /) -> Self | LiteralString: raise AssumedToBeImplementedException

removesuffix

removesuffix(suffix: LiteralString) -> LiteralString
removesuffix(suffix: str) -> Self
removesuffix(suffix: str | LiteralString) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def removesuffix(self, suffix: str | LiteralString, /) -> Self | LiteralString: raise AssumedToBeImplementedException

replace

replace(old: LiteralString, new: LiteralString, count: SupportsIndex = -1) -> LiteralString
replace(old: str, new: str, count: SupportsIndex = -1) -> Self
replace(
    old: str | LiteralString, new: str | LiteralString, count: SupportsIndex = -1
) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def replace(self, old: str | LiteralString, new: str | LiteralString, count: SupportsIndex = -1, /) -> Self | LiteralString: raise AssumedToBeImplementedException

rfind

rfind(sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def rfind(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException

rindex

rindex(sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def rindex(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: raise AssumedToBeImplementedException

rjust

rjust(width: SupportsIndex, fillchar: LiteralString = ' ') -> LiteralString
rjust(width: SupportsIndex, fillchar: str = ' ') -> Self
rjust(width: SupportsIndex, fillchar: str | LiteralString = ' ') -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def rjust(self, width: SupportsIndex, fillchar: str | LiteralString = " ", /) -> Self | LiteralString: raise AssumedToBeImplementedException

rpartition

rpartition(sep: LiteralString) -> tuple[LiteralString, LiteralString, LiteralString]
rpartition(sep: str) -> tuple[Self, Self, Self]
rpartition(
    sep: str | LiteralString,
) -> tuple[Self, Self, Self] | tuple[LiteralString, LiteralString, LiteralString]
Source code in src/omnipy/shared/protocols/builtins.py
def rpartition(self, sep: str | LiteralString, /) -> tuple[Self, Self, Self] | tuple[LiteralString, LiteralString, LiteralString]: raise AssumedToBeImplementedException

rsplit

rsplit(sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]
rsplit(sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[Self]
rsplit(
    sep: str | LiteralString | None = None, maxsplit: SupportsIndex = -1
) -> list[Self] | list[LiteralString]
Source code in src/omnipy/shared/protocols/builtins.py
def rsplit(self, sep: str | LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[Self] | list[LiteralString]: raise AssumedToBeImplementedException

rstrip

rstrip(chars: LiteralString | None = None) -> LiteralString
rstrip(chars: str | None = None) -> Self
rstrip(chars: str | None = None) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def rstrip(self, chars: str | None = None, /) -> Self | LiteralString: raise AssumedToBeImplementedException

split

split(sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]
split(sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[Self]
split(
    sep: str | LiteralString | None = None, maxsplit: SupportsIndex = -1
) -> list[Self] | list[LiteralString]
Source code in src/omnipy/shared/protocols/builtins.py
def split(self, sep: str | LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[Self] | list[LiteralString]: raise AssumedToBeImplementedException

splitlines

splitlines(keepends: bool = False) -> list[LiteralString]
splitlines(keepends: bool = False) -> list[Self]
splitlines(keepends: bool = False) -> list[Self] | list[LiteralString]
Source code in src/omnipy/shared/protocols/builtins.py
def splitlines(self, keepends: bool = False) -> list[Self] | list[LiteralString]: raise AssumedToBeImplementedException

startswith

startswith(
    prefix: str | tuple[str, ...],
    start: SupportsIndex | None = None,
    end: SupportsIndex | None = None,
) -> bool
Source code in src/omnipy/shared/protocols/builtins.py
def startswith(
    self, prefix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
) -> bool: raise AssumedToBeImplementedException

strip

strip(chars: LiteralString | None = None) -> LiteralString
strip(chars: str | None = None) -> Self
strip(chars: str | LiteralString | None = None) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def strip(self, chars: str | LiteralString | None = None, /) -> Self | LiteralString: raise AssumedToBeImplementedException

swapcase

swapcase() -> LiteralString
swapcase() -> Self
swapcase() -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def swapcase(self) -> Self | LiteralString: raise AssumedToBeImplementedException

title

title() -> LiteralString
title() -> Self
title() -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def title(self) -> Self | LiteralString: raise AssumedToBeImplementedException

translate

translate(table: _TranslateTable) -> Self
Source code in src/omnipy/shared/protocols/builtins.py
def translate(self, table: _TranslateTable, /) -> Self: raise AssumedToBeImplementedException

upper

upper() -> LiteralString
upper() -> Self
upper() -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def upper(self) -> Self | LiteralString: raise AssumedToBeImplementedException

zfill

zfill(width: SupportsIndex) -> LiteralString
zfill(width: SupportsIndex) -> Self
zfill(width: SupportsIndex) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
def zfill(self, width: SupportsIndex, /) -> Self | LiteralString: raise AssumedToBeImplementedException

IsTuple

Bases: IsItemSequence[_T_co], Protocol[_T_co]

Protocol with the same interface as the builtin class tuple.

METHOD DESCRIPTION
count
index
Source code in src/omnipy/shared/protocols/builtins.py
class IsTuple(IsItemSequence[_T_co], Protocol[_T_co]):  # type: ignore[misc]
    """Protocol with the same interface as the builtin class `tuple`.
    """
    # def __new__(cls, iterable: Iterable[_T_co] = (), /) -> Self: ...
    def __len__(self) -> int: raise AssumedToBeImplementedException
    def __contains__(self, key: object, /) -> bool: raise AssumedToBeImplementedException

    @overload
    def __getitem__(self, key: SupportsIndex, /) -> _T_co: raise AssumedToBeImplementedException
    @overload
    # def __getitem__(self, key: slice[SupportsIndex | None], /) -> tuple[_T_co, ...]:
    def __getitem__(self, key: slice, /) -> tuple[_T_co, ...]: raise AssumedToBeImplementedException
    def __getitem__(self, key: slice | SupportsIndex, /) -> tuple[_T_co, ...] | _T_co: raise AssumedToBeImplementedException

    def __iter__(self) -> Iterator[_T_co]: raise AssumedToBeImplementedException
    def __lt__(self, value: tuple[_T_co, ...], /) -> bool: raise AssumedToBeImplementedException
    def __le__(self, value: tuple[_T_co, ...], /) -> bool: raise AssumedToBeImplementedException
    def __gt__(self, value: tuple[_T_co, ...], /) -> bool: raise AssumedToBeImplementedException
    def __ge__(self, value: tuple[_T_co, ...], /) -> bool: raise AssumedToBeImplementedException
    def __eq__(self, value: object, /) -> bool: raise AssumedToBeImplementedException
    def __hash__(self) -> int: raise AssumedToBeImplementedException

    @overload
    def __add__(self, value: tuple[_T_co, ...], /) -> tuple[_T_co, ...]: raise AssumedToBeImplementedException
    @overload
    def __add__(self, value: tuple[_T, ...], /) -> tuple[_T_co | _T, ...]: raise AssumedToBeImplementedException
    def __add__(self, value: tuple[_T, ...] | tuple[_T_co, ...], /) -> tuple[_T_co | _T, ...] | tuple[_T_co, ...]: raise AssumedToBeImplementedException

    def __mul__(self, value: SupportsIndex, /) -> tuple[_T_co, ...]: raise AssumedToBeImplementedException
    def __rmul__(self, value: SupportsIndex, /) -> tuple[_T_co, ...]: raise AssumedToBeImplementedException
    def count(self, value: Any, /) -> int: raise AssumedToBeImplementedException
    def index(self, value: Any, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize, /) -> int: raise AssumedToBeImplementedException

count

count(value: Any) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def count(self, value: Any, /) -> int: raise AssumedToBeImplementedException

index

index(value: Any, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize) -> int
Source code in src/omnipy/shared/protocols/builtins.py
def index(self, value: Any, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize, /) -> int: raise AssumedToBeImplementedException

frozendict

Bases: Mapping[_KT, _VT]

METHOD DESCRIPTION
__init__
copy
items
keys
values
Source code in src/omnipy/shared/protocols/builtins.py
@disjoint_base
class frozendict(Mapping[_KT, _VT]):
    @overload
    def __new__(cls, /) -> frozendict[Any, Any]: ...
    @overload
    def __new__(cls: type[frozendict[str, _VT]], /, **kwargs: _VT) -> frozendict[str, _VT]: ...
    @overload
    def __new__(cls, map: SupportsKeysAndGetItem[_KT, _VT], /) -> frozendict[_KT, _VT]: ...
    @overload
    def __new__(
        cls: type[frozendict[str, _VT]], map: SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT
    ) -> frozendict[str, _VT]: ...
    @overload
    def __new__(cls, iterable: Iterable[tuple[_KT, _VT]], /) -> frozendict[_KT, _VT]: ...
    @overload
    def __new__(
        cls: type[frozendict[str, _VT]], iterable: Iterable[tuple[str, _VT]], /, **kwargs: _VT
    ) -> frozendict[str, _VT]: ...

    def __init__(self) -> None: ...
    def copy(self) -> frozendict[_KT, _VT]: ...

    @overload
    @classmethod
    def fromkeys(cls, iterable: Iterable[_T], value: None = None, /) -> frozendict[_T, Any | None]: ...
    @overload
    @classmethod
    def fromkeys(cls, iterable: Iterable[_T], value: _S, /) -> frozendict[_T, _S]: ...

    @overload  # type: ignore[override]
    def get(self, key: _KT, default: None = None, /) -> _VT | None: ...
    @overload
    def get(self, key: _KT, default: _VT, /) -> _VT: ...
    @overload
    def get(self, key: _KT, default: _T, /) -> _VT | _T: ...

    def keys(self) -> dict_keys[_KT, _VT]: ...
    def values(self) -> dict_values[_KT, _VT]: ...
    def items(self) -> dict_items[_KT, _VT]: ...
    def __len__(self) -> int: ...
    def __getitem__(self, key: _KT, /) -> _VT: ...
    def __reversed__(self) -> Iterator[_KT]: ...
    def __iter__(self) -> Iterator[_KT]: ...
    def __hash__(self) -> int: ...
    def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
    def __or__(self, value: dict[_T1, _T2] | frozendict[_T1, _T2], /) -> frozendict[_KT | _T1, _VT | _T2]: ...

    @overload
    def __ror__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ...
    @overload
    def __ror__(self, value: frozendict[_T1, _T2], /) -> frozendict[_KT | _T1, _VT | _T2]: ...

__init__

__init__() -> None
Source code in src/omnipy/shared/protocols/builtins.py
def __init__(self) -> None: ...

copy

copy() -> frozendict[_KT, _VT]
Source code in src/omnipy/shared/protocols/builtins.py
def copy(self) -> frozendict[_KT, _VT]: ...

items

items() -> dict_items[_KT, _VT]
Source code in src/omnipy/shared/protocols/builtins.py
def items(self) -> dict_items[_KT, _VT]: ...

keys

keys() -> dict_keys[_KT, _VT]
Source code in src/omnipy/shared/protocols/builtins.py
def keys(self) -> dict_keys[_KT, _VT]: ...

values

values() -> dict_values[_KT, _VT]
Source code in src/omnipy/shared/protocols/builtins.py
def values(self) -> dict_values[_KT, _VT]: ...