Python 3: Plist as OrderedDict

Raymond Hettinger python at rcn.com
Tue Feb 9 02:15:57 EST 2010


On Feb 8, 8:02 pm, Gnarlodious <gnarlodi... at gmail.com> wrote:
> I am trying to read a *.plist into Python 3's OrderedDict but can't
> figure it out. Saying something like this:
...
> I "upgraded" to Py3 to have OrderedDict, so please don't say it is
> impossible...

You may be able to monkey patch an OrderedDict into the PlistParser.
Here's an untested stab at it:

    from collections import OrderedDict
    import plistlib
    plistlib._InteralDict = OrderedDict

Raymond





More information about the Python-list mailing list