"""
Objects related to PyBuffer and PyStr
"""

from collections.abc import Sequence
from typing import Any, final

@final
class BytesExtractor:
    """
    This is for confirming that PyBuffer does not cause memory leak
    """
    def __new__(cls, /) -> BytesExtractor: ...
    @staticmethod
    def from_buffer(buf: Any) -> int: ...
    @staticmethod
    def from_bytes(bytes: bytes) -> int: ...
    @staticmethod
    def from_str(string: str) -> int: ...
    @staticmethod
    def from_str_lossy(string: str) -> int: ...

def map_byte_cow(bytes: Sequence[int]) -> bytes: ...
def map_byte_slice(bytes: bytes) -> bytes: ...
def map_byte_vec(bytes: Sequence[int]) -> bytes: ...
def return_memoryview() -> memoryview: ...
