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

Nested subclasses of typing.NamedTuple are not pickleable #82586

Closed
serhiy-storchaka opened this issue Oct 8, 2019 · 4 comments
Closed

Nested subclasses of typing.NamedTuple are not pickleable #82586

serhiy-storchaka opened this issue Oct 8, 2019 · 4 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 38405
Nosy @gvanrossum, @serhiy-storchaka, @ilevkivskyi, @miss-islington
PRs
  • bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. #16641
  • [3.8] bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641) #16655
  • [3.7] bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641). #16674
  • 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 = None
    closed_at = <Date 2019-10-09.09:58:47.335>
    created_at = <Date 2019-10-08.08:18:02.328>
    labels = ['3.7', '3.8', 'type-bug', 'library', '3.9']
    title = 'Nested subclasses of typing.NamedTuple are not pickleable'
    updated_at = <Date 2019-10-09.09:58:47.335>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2019-10-09.09:58:47.335>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-10-09.09:58:47.335>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2019-10-08.08:18:02.328>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38405
    keywords = ['patch']
    message_count = 4.0
    messages = ['354176', '354203', '354211', '354260']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'serhiy.storchaka', 'levkivskyi', 'miss-islington']
    pr_nums = ['16641', '16655', '16674']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue38405'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @serhiy-storchaka
    Copy link
    Member Author

    Example:

    >>> from typing import NamedTuple
    >>> import pickle
    >>> class A:
    ...     class B(NamedTuple):
    ...         x: int
    ... 
    >>> pickle.dumps(A.B)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    _pickle.PicklingError: Can't pickle <class '__main__.B'>: attribute lookup B on __main__ failed

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 8, 2019
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 13abda4 by Serhiy Storchaka in branch 'master':
    bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)
    13abda4

    @miss-islington
    Copy link
    Contributor

    New changeset 10b475a by Miss Islington (bot) in branch '3.8':
    bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)
    10b475a

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 87db4d3 by Serhiy Storchaka in branch '3.7':
    [3.7] bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641). (GH-16674)
    87db4d3

    @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
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants