martinblech / xmltodict

Python module that makes working with XML feel like you are working with JSON
MIT License
5.52k stars 462 forks source link

Request: Use normal dictionaries instead of OrderedDict #316

Open Guy-Markman opened 2 years ago

Guy-Markman commented 2 years ago

Can we get an option that parse will return the object as normal dictionaries instead of OrderedDict?

mpf82 commented 2 years ago

xmltodict.parse(xml, dict_constructor=dict) is already available since a few years.

If it's not working for you, you should state your Python version and your xmltodict version.

using dict instead of OrderedDict is also the default if you're using Python 3.7+ (dicts with insertion order are only an implementation detail in C-Python 3.6, not an official Python feature).

related issue: #252

ckuethe commented 1 year ago

The "dict_constructor" keyword is not mentioned in the docstring of parse() - not in v0.12.0, or at HEAD (https://github.com/martinblech/xmltodict/blob/master/xmltodict.py#L202).