I'd be +1 on adding a better named alias for loading strings to all of these libraries.
Seems to me like it is a pretty awful naming convention even if it is standard across the profession, and that adding load_string or load_str as an alias for loads would be a Very Good Thing (TM) with few downsides.
Two points in favor:
1. It is an obfuscated naming convention.
2. The presence of the loads() naming convention encourages people new to coding to do the exactly wrong thing and use MORE obfuscated names for their own methods and not less. In fact I took a cue from the standard library and added a loads() method to my own specialized file reader (for a soil FEA program) and regretted it later. I learned from my mistake that descriptive names are superior, and also that naming is hard, and thankfully it was relatively painless for me to change it.
Actually this issue has still been confusing for me sometimes even years after first using the API, since I haven't used these libraries often and tend not to remember it when I come back to them (this conversation will likely make it stick in my memory better).
I even think it would be preferable for the loads() documentation to say that it is an alias for load_str(), and not the other way around.
On Thu, Nov 28, 2019, 7:37 AM Wes Turner firstname.lastname@example.org wrote:
Maybe methods for learning to search the code and docs (rather than memorizing APIs) would be a worthwhile exercise?
# Python import json help(json)
# IPython !pydoc json import json json? json??
# RTD: Read The Docs (and/or update the docs) https://docs.python.org/3/search.html?q=loads
# RTS: Read The Source https://duckduckgo.com/?q=github+cpython+json
On Thursday, November 28, 2019, Abdur-Rahmaan Janhangeer < email@example.com> wrote:
"Designed With Learning in Mind"
Python-ideas mailing list -- firstname.lastname@example.org To unsubscribe send an email to email@example.com https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://firstname.lastname@example.org/message/YGP2BI... Code of Conduct: http://python.org/psf/codeofconduct/