Pickle&&json

Source: Internet
Author: User
  1. Dumps and loads are used in pairs, and dump and load are used in pairs.
  2. Dumps and loads because the serialized is the content, so the following to add S, but dump and load serialized content is the object, so singular.
  3. JSON can only handle simple data types, such as dictionaries, lists, strings, etc., and cannot handle complex data types such as functions.
  4. JSON is common in all languages, JSON is supported in all languages, and if we need python to interact with other languages, it is in JSON format.

  

  1. JSON supports only simple data types, and pickle supports all data types.
  2. Pickle can only support serialization and deserialization of Python itself and cannot be used as a data interaction with other languages, and JSON can.
  3. Pickle serializes the entire data object, so when deserializing the function, the logic in the function body changes, and is followed by the function body of the heart.
  4. Pickle and JSON in 3.0 can only dump once and load once, in 2.7 can dump several times, load several times, anyway, only remember, only need to dump once, load once.
Hashlib Module

Pickle&&json

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.