# Path: src/rustypy/rswrapper/rswrapper.py
# FIND_TYPE = re.compile("type\((.*)\)")
# class TupleMeta(type):
# class Tuple(metaclass=TupleMeta):
# class OpaquePtr(object):
# class KrateData(object):
# class RustBinds(object):
#     class FnCall(object):
#     def __new__(mcs, name, bases, namespace, parameters=None):
#         def check_type(arg_t, **checkers):
#     def __init__(cls, *args, **kwds):
#     def __len__(self):
#     def __getitem__(self, parameters):
#     def __repr__(self):
#     def element_type(self, pos):
#     def __subclasscheck__(self, cls):
#     def __iter__(self):
#     def __next__(self):
#     def __new__(cls, *args, **kwds):
# def _get_signature_types(params):
#     def inner_types(t):
#     def non_empty(param):
# def _get_ptr_to_C_obj(obj, sig=None):
# def _extract_pytypes(ref, sig=False, call_fn=None, depth=0):
# def get_crate_entry(mod):
# def bind_rs_crate_funcs(mod, lib, prefixes=None):
#     def __init__(self, prefixes):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def __iter__(self):
#     def __next__(self):
#     def __init__(self, entry_point, compiled_lib, prefixes=None):
#         def __init__(self, name, argtypes, lib):
#         def __call__(self, *args, **kwargs):
#         def real_restype(self):
#         def restype(self):
#         def restype(self, annotation):
#         def argtypes(self):
#         def argtypes(self):
#         def add_argtype(self, position, hint):
#         def get_argtype(self, position):
#     def decl_C_args(FFI, params):


import abc
from collections import deque
from enum import Enum, unique
from collections import abc as abc_coll
from rustypy.type_checkers import prev_to_37
from .ffi_defs import *
from .rswrapper import Float, Double, UnsignedLongLong, Tuple
            if next_e:
                c_backend.pytuple_push(next_e, prev_e)
            next_e = prev_e
        return prev_e


class PyList(PythonObject):

    def __init__(self, ptr, signature, call_fn=None):
        super().__init__(ptr)
        self._ptr = ptr
        self._len = c_backend.pylist_len(self._ptr)
        if not signature:
            raise MissingTypeHint(
                "rustypy: missing type hint for PyList unpacking in Python")
        self.signature = signature
        self.call_fn = call_fn

    def free(self):
        if hasattr(self, "_ptr"):
            c_backend.pylist_free(self._ptr)
            delattr(self, '_ptr')
            setattr(self, 'to_list', _dangling_pointer)

    def to_list(self, depth=0):
        sig = self.signature.__args__[0]
        arg_t = PythonObject.type_checking(sig)
        pylist = deque()
        last = self._len - 1
        if arg_t == PyEquivType.String:

# Path: src/rustypy/rswrapper/rswrapper.py
# FIND_TYPE = re.compile("type\((.*)\)")
# class TupleMeta(type):
# class Tuple(metaclass=TupleMeta):
# class OpaquePtr(object):
# class KrateData(object):
# class RustBinds(object):
#     class FnCall(object):
#     def __new__(mcs, name, bases, namespace, parameters=None):
#         def check_type(arg_t, **checkers):
#     def __init__(cls, *args, **kwds):
#     def __len__(self):
#     def __getitem__(self, parameters):
#     def __repr__(self):
#     def element_type(self, pos):
#     def __subclasscheck__(self, cls):
#     def __iter__(self):
#     def __next__(self):
#     def __new__(cls, *args, **kwds):
# def _get_signature_types(params):
#     def inner_types(t):
#     def non_empty(param):
# def _get_ptr_to_C_obj(obj, sig=None):
# def _extract_pytypes(ref, sig=False, call_fn=None, depth=0):
# def get_crate_entry(mod):
# def bind_rs_crate_funcs(mod, lib, prefixes=None):
#     def __init__(self, prefixes):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def __iter__(self):
#     def __next__(self):
#     def __init__(self, entry_point, compiled_lib, prefixes=None):
#         def __init__(self, name, argtypes, lib):
#         def __call__(self, *args, **kwargs):
#         def real_restype(self):
#         def restype(self):
#         def restype(self, annotation):
#         def argtypes(self):
#         def argtypes(self):
#         def add_argtype(self, position, hint):
#         def get_argtype(self, position):
#     def decl_C_args(FFI, params):


# Path: src/rustypy/rswrapper/pytypes.py
import abc
from collections import deque
from enum import Enum, unique
from collections import abc as abc_coll
from rustypy.type_checkers import prev_to_37
from .ffi_defs import *
from .rswrapper import Float, Double, UnsignedLongLong, Tuple

            if next_e:
                c_backend.pytuple_push(next_e, prev_e)
            next_e = prev_e
        return prev_e


class PyList(PythonObject):

    def __init__(self, ptr, signature, call_fn=None):
        super().__init__(ptr)
        self._ptr = ptr
        self._len = c_backend.pylist_len(self._ptr)
        if not signature:
            raise MissingTypeHint(
                "rustypy: missing type hint for PyList unpacking in Python")
        self.signature = signature
        self.call_fn = call_fn

    def free(self):
        if hasattr(self, "_ptr"):
            c_backend.pylist_free(self._ptr)
            delattr(self, '_ptr')
            setattr(self, 'to_list', _dangling_pointer)

    def to_list(self, depth=0):
        sig = self.signature.__args__[0]
        arg_t = PythonObject.type_checking(sig)
        pylist = deque()
        last = self._len - 1
        if arg_t == PyEquivType.String:

            for e in range(0, self._len):