You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe we should give this particular metadata representation a more representitive name instead? Like Structured Metadata or something (just a random idea).
Maybe, but that's only of use here if the representative name is short enough (or can be abbreviated) to use in a function name. I don't want a name like message_headers_to_structured_metadata, and I'm not sure msg_to_struct is much better than msg_to_dict... PEP 566 called it "JSON compatible metadata", which would actually argue for the current "json" as an abbreviation.
Note that the dict form isn't standardised (it was in one of the earlier PEPs but was apparently deliberately not carried forward into packaging.python.org). IMO that was a mistake, but there you have it. If someone wanted to propose adding that representation back in, giving it a proper name at the same time, I'd be in favour, but I don't have the energy to fight for it myself.
This should probably be
msg_to_dict
instead since the output is not actually JSON (which should be a str), but a dict decoded from JSON metadata.Originally posted by @uranusjr in pypa/pip#11095 (comment)
I tend to refer to the type as "JSON-compatible dict", which is too long for a method name. But dict is probably better than json as an abbreviation.
The text was updated successfully, but these errors were encountered: