On Nov 28, 2019, at 06:31, Ricky Teachey <ri...@teachey.org> wrote:
> 
> I'd be +1 on adding a better named alias for loading strings to all of these 
> libraries. 

Including the ones that aren’t in the stdlib? If so, how do we do that? 

If not, won’t it be even more confusing for people who learn json.load_string 
when they go to use PyYAML and there’s no yaml.load_string? Sure, they’ll 
complain to the PyYAML devs, and eventually, most of the most common libraries 
will catch up, but you’re talking about a few years of extra confusion before 
you get the long-term benefits. 

Also, all the existing code, tutorials, StackOverflow answers, etc. that uses 
loads will still be using loads, so most people are going to have to learn what 
it means anyway.

People are still getting confused over find_all vs. findall and writing 
StackOverflow questions asking why some module is giving them a NameError when 
they try to use findall a decade later. And the same is true for some of the 
pep8-naming changes that came with 3.0; you can still find StackOverflow 
questions where the accepted answer on the canonical dup question says to use 
threading.currentThread even though current_thread was added, and currentThread 
turned into a compatibility alias, back in 2.6.

So the Very Good Thing isn’t actually as good as you’d hope—people will still 
have to learn loads—and the downsides are bigger than they appear at first—it 
will be a years-long process to get the entire Python ecosystem consistent on a 
new naming convention.

That doesn’t mean it definitely isn’t worth doing, but it does mean you need to 
argue that it’s compelling enough to be worth the tradeoff anyway, rather than 
ignoring the cost and arguing as if we had a time machine and could go back to 
whenever pickle was added and change history to avoid all the downsides.

As a side note: I found it much more confusing when I learned pickle that the 
opposite of load was not store, but dump. To me, dump sounds like a debugging 
function that would format a pickle with all relevant details and print it to 
stderr (much like dis), not a function you’d use to convert an object to a 
pickle and save in a file.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/LRW4DUF4SR25ZZXZBQUS3DYFZQIT7SVD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to