This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients ChrisCooper, docs@python, dstufft, ezio.melotti, ncoghlan, pitrou, terry.reedy, westley.martinez
Date 2013-12-04.12:40:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386160838.54.0.583691501221.issue18840@psf.upfronthosting.co.za>
In-reply-to
Content
Since this particular tutorial section was written long before the json module was part of the standard library, I think it makes sense to switch now we have the option.

pickle is definitely a useful tool, but now that JSON is available by default, it's now one to escalate to if JSON doesn't meet your needs, rather than the one to use by default.

Chris's patch looks generally good to me, although I think it could use a second paragraph in the pickle section. Perhaps something like:

"""JSON is much simpler to use safely than pickle, and offers broader interoperability with programs written in other languages. However, pickle has the advantage of supporting a much wider range of Python object types, including executable code, which means it can handle use cases that JSON can't (like sending code to another process for execution)"


This simpler/safer/less powerful API/technique vs more powerful/more dangerous API/technique trade-off is a fairly common one, so I think it's a good thing to have a concrete example of it in the tutorial rather than just dropping the reference to pickle entirely.
History
Date User Action Args
2013-12-04 12:40:38ncoghlansetrecipients: + ncoghlan, terry.reedy, pitrou, ezio.melotti, docs@python, westley.martinez, ChrisCooper, dstufft
2013-12-04 12:40:38ncoghlansetmessageid: <1386160838.54.0.583691501221.issue18840@psf.upfronthosting.co.za>
2013-12-04 12:40:38ncoghlanlinkissue18840 messages
2013-12-04 12:40:38ncoghlancreate