(ctype)
Return the Objective-C type encoding for the given ctypes type.

    If a type encoding has been registered for the ctype, that encoding is returned. Otherwise, if the ctype is a
    pointer type, its pointed-to type is encoded and used to construct the pointer type encoding.

    Automatic encoding of other compound types (arrays, structures, and unions) is currently not supported. To encode
    such types, a type encoding must be manually provided for them using :func:`register_preferred_encoding` or
    :func:`register_encoding`.

    :raises ValueError: if the conversion fails at any point
Return the Objective-C type encoding for the given ctypes type.
Return the Objective - C type encoding for the given ctypes type .
def encoding_for_ctype(ctype):
    """Return the Objective-C type encoding for the given ctypes type.

    If a type encoding has been registered for the ctype, that encoding is returned. Otherwise, if the ctype is a
    pointer type, its pointed-to type is encoded and used to construct the pointer type encoding.

    Automatic encoding of other compound types (arrays, structures, and unions) is currently not supported. To encode
    such types, a type encoding must be manually provided for them using :func:`register_preferred_encoding` or
    :func:`register_encoding`.

    :raises ValueError: if the conversion fails at any point
    """

    try:
        return _encoding_for_ctype_map[ctype]
    except KeyError:
        try:
            return b'^' + encoding_for_ctype(ctype._type_)
        except KeyError:
            raise ValueError('No type encoding known for ctype {}'.format(ctype))
def encoding_for_ctype ( ctype ) : try : return _encoding_for_ctype_map [ ctype ] except KeyError : try : return b'^' + encoding_for_ctype ( ctype . _type_ ) except KeyError : raise ValueError ( 'No type encoding known for ctype {}' . format ( ctype ) )