[issue45093] Add method to compare dicts accounting for order

2021-09-03 Thread Michael Rans
Michael Rans added the comment: Thanks for all your help and advice. -- ___ Python tracker <https://bugs.python.org/issue45093> ___ ___ Python-bugs-list mailin

[issue45093] Add method to compare dicts accounting for order

2021-09-03 Thread Michael Rans
Michael Rans added the comment: Thank you. Another case is in round trip processing of JSON or YML. Other cases are where you would prefer an OrderedDict over a dict. I think the method would help clarify things because it would make it obvious that it is for ordered comparisons while

[issue45093] Add method to compare dicts accounting for order

2021-09-02 Thread Michael Rans
Michael Rans added the comment: My use case is in testing. Currently I use an OrderedDict, but since dict introduced ordering in 3.7, I was considering switching. For my test, I need to check that the dictionary is the same both in content and order. I can indeed use your one liner

[issue45093] Add method to compare dicts accounting for order

2021-09-02 Thread Michael Rans
Change by Michael Rans : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue45093> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue45093] Add method to compare dicts accounting for order

2021-09-02 Thread Michael Rans
New submission from Michael Rans : I suggest adding a method that allows comparing dicts taking into account the order - an ordered compare (since == does not do that). (Also for my other issue (https://bugs.python.org/issue45092) where I suggested that set be ordered to reduce confusion

[issue45092] Make set ordered like dict

2021-09-02 Thread Michael Rans
New submission from Michael Rans : Now that dict is ordered, it is a bit confusing that set isn't as well. I suggest making set ordered too. -- messages: 400974 nosy: mcarans priority: normal severity: normal status: open title: Make set ordered like dict type: behavior versions