pyufunc.pickle_save#

pyufunc.pickle_save(obj, filename, base_dir='/home/docs/checkouts/readthedocs.org/user_builds/pyufunc/checkouts/latest/docs/source')#

Save an object to a file using the pickle module. The object could be a function, a class, a list, dictionary, a string, an int, float, tuple, set, or any other object that can be pickled.

Parameters:
  • obj – The object to save.

  • filename (str | Path) – The filename to save the object to.

  • base_dir (str, optional) – The directory to save the file in. Defaults to the current working directory.

Raises:

AssertionError – filename must be a string or Path, not {type(filename)}

Returns:

None

Example

>>> from pyufunc import pickle_save
>>> pickle_save(obj, "file.pkl")