Frankly,
I’ve often wanted this for other things that share a similar API, JSON
comes to mind.
Loading from/saving to a file is a pretty common thing— nice to make it
easy.
And JSON at least has *s versions for strings, so no confusion there.
But it’s been this way a LONG time, and with a gener
07.02.20 20:41, Antoine Pitrou пише:
What you call "quite a bit of boilerplate" is just an additional line
of code. If you are frequently being bothered by this (I'm curious
what the context is?), it's easy to add the desired helper function to
your own library.
In general, I don't think adding
> On Feb 7, 2020, at 10:21, Todd wrote:
>
> I think it would be nice if pickle.dump and pickle.load would also accept a
> filename or path.
Pickle intentionally has the same API as marshal, and so do a number of other
modules—not just in the stdlib, but popular third party modules. So, I don’t
On Fri, 7 Feb 2020 13:03:52 -0500
Todd wrote:
> Currently with pickle you have to "open" the file separately from the
> pickle operation, generally using a "with" clause, then provide the file
> object to one of the pickle.dump or pickle.load. This adds quite a bit of
> boilerplate for simply sav