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

copyreg doesn't support keyword only arguments in __new__ #48977

Closed
erickt mannequin opened this issue Dec 23, 2008 · 7 comments
Closed

copyreg doesn't support keyword only arguments in __new__ #48977

erickt mannequin opened this issue Dec 23, 2008 · 7 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@erickt
Copy link
Mannequin

erickt mannequin commented Dec 23, 2008

BPO 4727
Nosy @jcea, @abalkin, @avassalotti, @serhiy-storchaka
Dependencies
  • bpo-17810: Implement PEP 3154 (pickle protocol 4)
  • Files
  • copy_getnewargs_ex.patch
  • 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/serhiy-storchaka'
    closed_at = <Date 2015-03-24.16:08:11.720>
    created_at = <Date 2008-12-23.02:35:02.277>
    labels = ['type-feature', 'library']
    title = "copyreg doesn't support keyword only arguments in __new__"
    updated_at = <Date 2015-03-24.20:38:48.835>
    user = 'https://bugs.python.org/erickt'

    bugs.python.org fields:

    activity = <Date 2015-03-24.20:38:48.835>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-03-24.16:08:11.720>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2008-12-23.02:35:02.277>
    creator = 'erickt'
    dependencies = ['17810']
    files = ['38032']
    hgrepos = []
    issue_num = 4727
    keywords = ['patch']
    message_count = 7.0
    messages = ['78222', '109264', '109266', '204973', '235503', '239178', '239179']
    nosy_count = 6.0
    nosy_names = ['jcea', 'belopolsky', 'alexandre.vassalotti', 'erickt', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue4727'
    versions = ['Python 3.5']

    @erickt
    Copy link
    Mannequin Author

    erickt mannequin commented Dec 23, 2008

    According to both of these bugs:

    http://bugs.python.org/issue1398
    http://bugs.python.org/issue4331

    pickle can't pickle functools.partial objects. It looks the underlying
    reason is that objects that pickle can't handle objects with __new__ and
    keyword only arguments. To support this, would this require a new pickle
    protocol and a __getnewfullargs__ that returns a tuple and dict?

    @erickt erickt mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Dec 23, 2008
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 4, 2010

    http://bugs.python.org/issue1398 has already been fixed and closed.
    http://bugs.python.org/issue4331 is still open and has seen activity as recently as 2010-02-23, so can this be closed or must it remain open?

    @abalkin
    Copy link
    Member

    abalkin commented Jul 4, 2010

    Please keep this open. This issue is separate from pickling partial objects.

    @avassalotti
    Copy link
    Member

    PEP-3154 implemented support for pickling classes taking keyword-only arguments.

    The copy module should be updated to use __getnewargs_ex__ when available through object.__reduce__(4).

    @avassalotti avassalotti changed the title pickle/copyreg doesn't support keyword only arguments in __new__ copyreg doesn't support keyword only arguments in __new__ Dec 1, 2013
    @serhiy-storchaka
    Copy link
    Member

    Here is a patch.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 24, 2015

    New changeset 83cbf61a972b by Serhiy Storchaka in branch 'default':
    Issue bpo-4727: Fixed issue number in Misc/NEWS.
    https://hg.python.org/cpython/rev/83cbf61a972b

    @serhiy-storchaka
    Copy link
    Member

    The patch actually was committed in changeset 34930a6faf0d.

    @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-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants