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

Make collections.deque json serializable #73849

Closed
tarekziade mannequin opened this issue Feb 27, 2017 · 3 comments
Closed

Make collections.deque json serializable #73849

tarekziade mannequin opened this issue Feb 27, 2017 · 3 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@tarekziade
Copy link
Mannequin

tarekziade mannequin commented Feb 27, 2017

BPO 29663
Nosy @rhettinger, @tarekziade, @serhiy-storchaka
Superseder
  • bpo-20774: collections.deque should ship with a stdlib json serializer
  • 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 2017-02-27.11:08:31.754>
    created_at = <Date 2017-02-27.10:21:30.955>
    labels = ['3.7', 'type-bug', 'library']
    title = 'Make collections.deque json serializable'
    updated_at = <Date 2017-02-27.11:08:31.753>
    user = 'https://github.com/tarekziade'

    bugs.python.org fields:

    activity = <Date 2017-02-27.11:08:31.753>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-02-27.11:08:31.754>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2017-02-27.10:21:30.955>
    creator = 'tarek'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 29663
    keywords = []
    message_count = 3.0
    messages = ['288629', '288630', '288635']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'tarek', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '20774'
    type = 'behavior'
    url = 'https://bugs.python.org/issue29663'
    versions = ['Python 3.7']

    @tarekziade
    Copy link
    Mannequin Author

    tarekziade mannequin commented Feb 27, 2017

    collections.deque could be serialized in JSON as a simple array.

    The only thing we can lose in the process is the maxlen value, but I think it's a decent behaviour to ignore it when encoding and to set it to None when decoding.

    @tarekziade tarekziade mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir labels Feb 27, 2017
    @rhettinger
    Copy link
    Contributor

    +1 This isn't really different that how we handle tuples and I can see that it would be useful to be able to dump a deque into JSON. I concur that it is reasonable to ignore maxlen because that is primarily a convenience feature (auto-popping on overflow) rather than something that is intrinsic to the semantics of data itself.

    @rhettinger rhettinger added the type-bug An unexpected behavior, bug, or error label Feb 27, 2017
    @serhiy-storchaka
    Copy link
    Member

    This is a duplicate of bpo-20774.

    @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 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