(aCollection, conversionHelper=None)
Converts a Foundation based property list into a Python
    collection (all members will be instances or subclasses of standard Python
    types)

    Like propertyListFromPythonCollection(), conversionHelper is an optional
    callable that will be invoked any time an encountered object cannot be
    converted.
Converts a Foundation based property list into a Python
    collection (all members will be instances or subclasses of standard Python
    types)
Converts a Foundation based property list into a Python collection ( all members will be instances or subclasses of standard Python types )
def pythonCollectionFromPropertyList(aCollection, conversionHelper=None):
    """
    Converts a Foundation based property list into a Python
    collection (all members will be instances or subclasses of standard Python
    types)

    Like propertyListFromPythonCollection(), conversionHelper is an optional
    callable that will be invoked any time an encountered object cannot be
    converted.
    """
    if isinstance(aCollection, Foundation.NSDictionary):
        pyCollection = {}
        for k in aCollection:
            if not isinstance(k, basestring):
                raise TypeError("Property list keys must be strings")
            convertedValue = pythonCollectionFromPropertyList(
                aCollection[k], conversionHelper)
            pyCollection[k] = convertedValue
        return pyCollection
    elif isinstance(aCollection, Foundation.NSArray):
        return [
            pythonCollectionFromPropertyList(item, conversionHelper)
            for item in aCollection
        ]
    elif isinstance(aCollection, Foundation.NSData):
        return buffer(aCollection)
    elif isinstance(aCollection, Foundation.NSDate):
        return datetime.datetime.fromtimestamp(
            aCollection.timeIntervalSince1970())
    elif isinstance(aCollection, Foundation.NSDecimalNumber) and decimal is not None:
        return toPythonDecimal(aCollection)
    elif aCollection is Foundation.NSNull.null():
        return None
    elif isinstance(aCollection, PYTHON_TYPES):
        return aCollection
    elif conversionHelper:
        return conversionHelper(aCollection)
    raise TypeError("Type '%s' encountered in ObjC collection;  don't know how to convert." % type(aCollection))
def pythonCollectionFromPropertyList ( aCollection , conversionHelper = None ) : if isinstance ( aCollection , Foundation . NSDictionary ) : pyCollection = { } for k in aCollection : if not isinstance ( k , basestring ) : raise TypeError ( "Property list keys must be strings" ) convertedValue = pythonCollectionFromPropertyList ( aCollection [ k ] , conversionHelper ) pyCollection [ k ] = convertedValue return pyCollection elif isinstance ( aCollection , Foundation . NSArray ) : return [ pythonCollectionFromPropertyList ( item , conversionHelper ) for item in aCollection ] elif isinstance ( aCollection , Foundation . NSData ) : return buffer ( aCollection ) elif isinstance ( aCollection , Foundation . NSDate ) : return datetime . datetime . fromtimestamp ( aCollection . timeIntervalSince1970 ( ) ) elif isinstance ( aCollection , Foundation . NSDecimalNumber ) and decimal is not None : return toPythonDecimal ( aCollection ) elif aCollection is Foundation . NSNull . null ( ) : return None elif isinstance ( aCollection , PYTHON_TYPES ) : return aCollection elif conversionHelper : return conversionHelper ( aCollection ) raise TypeError ( "Type '%s' encountered in ObjC collection;  don't know how to convert." % type ( aCollection ) )