Skip to content

import Pickler class directly from the pickle module #458

@jvesely

Description

@jvesely

from _pickle import Pickler # noqa: F401

uses _pickle module to import Pickler. However, as per python 3.8 documentation[0] this class is available directly in the pickle module.

from pickle import Pickler

works ok and it is equivalent to _pickle.Pickler

$ python 
Python 3.9.7 (default, Nov  1 2021, 14:08:06) 
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from _pickle import Pickler as p
>>> import pickle
>>> p is pickle.Pickler
True
>>>

[0] https://docs.python.org/3.8/library/pickle.html#pickle.Pickler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions