(encoding)
Return the ctype corresponding to an Objective-C type encoding.

    If a ctype has been registered for the encoding, that type is returned. Otherwise, if the type encoding represents
    a compound type (pointer, array, structure, or union), the contained types are converted recursively. A new ctype
    is then created from the converted ctypes, and is registered for the encoding (so that future conversions of the
    same encoding return the same ctype).

    For example, the type encoding ``{spam=ic}`` is not registered by default. However, the contained types ``i`` and
    ``c`` are registered, so they are converted individually and used to create a new :class:`~ctypes.Structure` with
    two fields of the correct types. The new structure type is then registered for the original encoding ``{spam=ic}``
    and returned.

    :raises ValueError: if the conversion fails at any point
Return the ctype corresponding to an Objective-C type encoding.
Return the ctype corresponding to an Objective - C type encoding .
def ctype_for_encoding(encoding):
    """Return the ctype corresponding to an Objective-C type encoding.

    If a ctype has been registered for the encoding, that type is returned. Otherwise, if the type encoding represents
    a compound type (pointer, array, structure, or union), the contained types are converted recursively. A new ctype
    is then created from the converted ctypes, and is registered for the encoding (so that future conversions of the
    same encoding return the same ctype).

    For example, the type encoding ``{spam=ic}`` is not registered by default. However, the contained types ``i`` and
    ``c`` are registered, so they are converted individually and used to create a new :class:`~ctypes.Structure` with
    two fields of the correct types. The new structure type is then registered for the original encoding ``{spam=ic}``
    and returned.

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

    # Remove qualifiers, as documented in Table 6-2 here:
    # https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html
    encoding = encoding.lstrip(b"NORVnor")

    try:
        # Look up known type encodings directly.
        return _ctype_for_encoding_map[encoding]
    except KeyError:
        return _ctype_for_unknown_encoding(encoding)
def ctype_for_encoding ( encoding ) : # Remove qualifiers, as documented in Table 6-2 here: # https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html encoding = encoding . lstrip ( b"NORVnor" ) try : # Look up known type encodings directly. return _ctype_for_encoding_map [ encoding ] except KeyError : return _ctype_for_unknown_encoding ( encoding )