Skip to content

PEP 416: Add a builtin frozendict type #58370

Description

@vstinner
BPO 14162
Nosy @vstinner
Files
  • frozendict.patch
  • frozendict_builtins.patch
  • type_final.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 = None
    closed_at = <Date 2012-03-26.20:22:50.839>
    created_at = <Date 2012-02-29.18:05:03.872>
    labels = ['interpreter-core', 'type-feature']
    title = 'PEP 416: Add a builtin frozendict type'
    updated_at = <Date 2012-03-26.20:22:50.837>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2012-03-26.20:22:50.837>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-03-26.20:22:50.839>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2012-02-29.18:05:03.872>
    creator = 'vstinner'
    dependencies = []
    files = ['24685', '24690', '24696']
    hgrepos = []
    issue_num = 14162
    keywords = ['patch']
    message_count = 5.0
    messages = ['154655', '154656', '154670', '154690', '156866']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue14162'
    versions = ['Python 3.3']

    Linked PRs

    Activity

    1. vstinner commented on Feb 29, 2012

      @vstinner
      MemberAuthor

      Patch to implement the PEP-416.

    2. vstinner commented on Feb 29, 2012

      @vstinner
      MemberAuthor

      There is no documentation update yet.

    3. vstinner commented on Mar 1, 2012

      @vstinner
      MemberAuthor

      frozendict_builtins.patch: make CPython supports frozendict for the __builtins__ mapping. It is an example of frozendict usage which helps my pysandbox project.

    4. changed the title [-]Implementation of the PEP 416 (Add a builtin frozendict type)[/-] [+]PEP 416: Add a builtin frozendict type[/+] on Mar 1, 2012
    5. vstinner commented on Mar 1, 2012

      @vstinner
      MemberAuthor

      Another frozendict usage example: freeze the dict of a new type if it contains __final__ in its namespace.

      Example:

      >>> class Classic:
      ...     pass
      ... 
      >>> Classic.attr=1
      >>> class FinalizedType:
      ...     __final__=True
      ... 
      >>> FinalizedType.attr=1
      (...)
      TypeError: 'frozendict' object does not support item assignment

      This patch is not part of the PEP-416 and is just a proof-of-concept.

    6. vstinner commented on Mar 26, 2012

      @vstinner
      MemberAuthor

      The PEP has been rejected. See issue bpo-14386 for a new mappingview type.

    7. transferred this issue fromon Apr 10, 2022
    8. added a commit that references this issue on Jun 2, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions