googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
151 stars 43 forks source link

Use regular dictionaries instead of OrderedDict #545

Closed khaledhosny closed 2 years ago

khaledhosny commented 3 years ago

Python 3.7+ dictionaries are guaranteed to keep insertion order.

anthrotype commented 3 years ago

there are still a few differences between dict and OrderedDict even after 3.7+ (see https://stackoverflow.com/a/50872567) but I think for our use case it's fine with plain dict, so LGTM

anthrotype commented 3 years ago

as you probably already know, OrderedDict was rewritten in C ever since Python 3.5 so I believe there should not be significant differences in performance. I like that OrderedDict makes explicit the intent of the author, that the insertion order is meaninful..

khaledhosny commented 3 years ago

OK, I have no strong opinion either way, I just find plain dict’s a bit more ergonomic. I’m fine with closing this.