Pickling is just the Python way of saying serializing. Pickling lets you serialize an object into a string (or anything else you choose) in order to be persisted on storage or sent over network. Unpickling is the process of restoring the original object from a pickled string.
Pickle is not secure. Only unpickle objects from trusted sources
Python docs
Here is how you would pickle a basic data structure:
import pickle
cars = {"Subaru": "best car", "Toyota": "no i am the best car"}
cars_serialized = pickle.dumps(cars)
# cars_serialized is a byte string
new_cars = pickle.loads(cars_serialized)
What are *args and **kwargs in Python functions?
These deal closely with unpacking. If you put *args in function’s parameter list, all unnamed arguments will be stored in the args array. **kwargs works the same way, but for named parameters:
def func1(*args, **kwargs):
print(args)
print(kwargs)
func1(1, 'abc', lol='lmao')
> [1, 'abc']
> {"lol": "lmao"}