What is Pickle?
Python's built-in module for serializing and deserializing Python objects into a byte stream for storage or transmission.
Pickle converts Python objects (lists, dictionaries, classes, machine learning models) to bytes and back. Usage: pickle.dump(obj, file) to save, pickle.load(file) to restore. It handles complex object graphs including circular references.
Security warning: Never unpickle data from untrusted sources — it can execute arbitrary code. For safe serialization, use JSON (simple types), MessagePack, or Protocol Buffers. Pickle is useful for caching, ML model storage, and inter-process communication.