<#7082 drop sorted() and OrderedDict in CoercingEn...
# github-notifications
c
#7082 drop sorted() and OrderedDict in CoercingEncoder after dropping python 2 Issue created by cosmicexplorer We refactored
stable_json_hash()
to become
stable_json_sha1()
in #6475. It is possible for python 2.7 to have random dict key ordering (see this comment in that PR), but in 3.6+ the ordering is always stable (although not stable across python versions, which is fine). We can drop the
sorted()
and
OrderedDict
encoding and simply return a dict with keys
k
encoded with
self._maybe_encode_dict_key(k)
, and values
v
with
self.default(v)
, as is shown in a subsequent comment on that PR. We would need to profile this, but it's possible this could speed up initialization. pantsbuild/pants