Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge pickle and cPickle in 3.0 #47166

Closed
brettcannon opened this issue May 19, 2008 · 9 comments
Closed

merge pickle and cPickle in 3.0 #47166

brettcannon opened this issue May 19, 2008 · 9 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@brettcannon
Copy link
Member

BPO 2917
Nosy @brettcannon, @kbkaiser, @giampaolo, @avassalotti, @benjaminp
Files
  • _pickle.c
  • changeset-1.diff
  • changeset-2.diff
  • add-cpickle-1.patch
  • add-cpickle-2.patch
  • fix_pickle_int64.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/avassalotti'
    closed_at = <Date 2008-06-13.02:50:24.552>
    created_at = <Date 2008-05-19.19:59:20.993>
    labels = ['type-bug', 'library']
    title = 'merge pickle and cPickle in 3.0'
    updated_at = <Date 2008-06-13.02:50:24.551>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2008-06-13.02:50:24.551>
    actor = 'alexandre.vassalotti'
    assignee = 'alexandre.vassalotti'
    closed = True
    closed_date = <Date 2008-06-13.02:50:24.552>
    closer = 'alexandre.vassalotti'
    components = ['Library (Lib)']
    creation = <Date 2008-05-19.19:59:20.993>
    creator = 'brett.cannon'
    dependencies = []
    files = ['10501', '10519', '10566', '10567', '10592', '10601']
    hgrepos = []
    issue_num = 2917
    keywords = ['patch']
    message_count = 9.0
    messages = ['67071', '67629', '67695', '67882', '68027', '68034', '68049', '68071', '68119']
    nosy_count = 5.0
    nosy_names = ['brett.cannon', 'kbk', 'giampaolo.rodola', 'alexandre.vassalotti', 'benjamin.peterson']
    pr_nums = []
    priority = 'critical'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue2917'
    versions = ['Python 3.0']

    @brettcannon
    Copy link
    Member Author

    cPickle should be gone in 3.0 and pickle should have an accelerated
    version behind it, when available.

    Alexandre has been working on this (might even be checked in), so
    assigning to him to help track for PEP-3108 work.

    @brettcannon brettcannon added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels May 19, 2008
    @avassalotti
    Copy link
    Member

    Here is the fully reviewed and shiny C optimized pickle module. :-)

    Note, I am only posting the _pickle.c source code for now. I still need
    to work out a few details out. For example, there is a few methods that
    needs to be exposed in the public API -- i.e., Unpickler.find_class()
    and Pickler.save_reduce(). Also, instantiate() needs to reworked to
    match the one in pickle.py. Anyway, I am now pretty confident that I
    will have the time to finalize these details before the beta.

    @avassalotti
    Copy link
    Member

    Here is a diff against the previously posted _pickle.c module. The
    module is pretty much done now. I fixed find_class() to be a proper
    method and move the initialization code of Pickler/Unpickler into the
    tp_init slot to allow proper subclassing.

    The only things I didn't do is make save_reduce() public (since it would
    be useless) and fix instantiate() to be exactly the same as in pickle.py
    (since I have no idea how to cleanly inject a __class__ attribute into a
    pre-build empty class from C).

    With the beta postponed, I will probably add some optimizations to the
    module and update the stdlib documentation.

    @avassalotti
    Copy link
    Member

    Here is the full patch that adds the _pickle module. I would like to
    commit it as soon another developer tests it and (hopefully) reviews it.

    A documentation patch is coming as well. However since I don't want to
    block the release just for documentation patch, I will post it as a
    separate issue.

    @avassalotti
    Copy link
    Member

    I updated the patch to use the new module framework.

    @avassalotti
    Copy link
    Member

    Committed in r64152.

    @benjaminp
    Copy link
    Contributor

    I'm sorry. I had to revert this.

    @avassalotti
    Copy link
    Member

    Okay, I fixed _pickle's integers unpickling on 64bit platforms. Here is
    the patch.

    @avassalotti
    Copy link
    Member

    Restored _pickle in r64180.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants