GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove `ma_version_tag` (PEP 699 / PEP 509) · Issue #124296 · python/cpython

Remove ma_version_tag (PEP 699 / PEP 509) #124296

New issue
Copy link
New issue
Copy link
Closed
Closed
Remove ma_version_tag (PEP 699 / PEP 509)#124296
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement

Description

@colesbury
colesbury
opened on Sep 20, 2024
Issue body actions

Feature or enhancement

The accepted PEP 699 proposed removing the private ma_version_tag field from PyDictObject. Note that PEP 699 supersedes PEP 509, which originally proposed the field.

Why now?

  • The ma_version_tag field was deprecated in 3.12 and we are now working on 3.14, so I think this is in line with Python's backward compatibility policy from PEP 387.
  • Cython and PyTorch (dynamo) and Nuitka have stopped using it for CPython 3.12+. I don't think ma_version_tag ever saw widespread usage. Cython was the major user mentioned in PEP 699. 1
  • I think the ma_version_tag updates have a non-negligible cost in the free-threaded build, and it's easier and simpler to remove it (if we're planning to do that anyways) than to make it more efficient
  • It would be convenient to use some of the version tag bits for per-thread refcounting of globals and builtins. (See Mark's comment in Reference count contention with nested functions #124218 (comment)).
  • If we are going to remove this in 3.14, I think doing so earlier in the development cycle is better.

Dict Watchers

The ma_version_tag field is also used for dict watchers (8 bits) and the tier2 mutation counter (4 bits). We will still want that functionality.

cc @Fidget-Spinner @markshannon

Linked PRs

  • gh-124296: Remove private dictionary version tag (PEP 699) #124472

Footnotes

  1. I searched the top ~7500 sdists as well. The only other actual usage I saw was https://github.com/slezica/python-frozendict, which doesn't have a 3.11 or 3.12 C extension yet (but also functions as a pure-Python package). ↩

Reacted by Donghee Na, Ken Jin, Itamar Oren, Shantanu and Victor Stinner

Activity

  1. colesbury
    added
    type-featureA feature request or enhancementA feature request or enhancement
    performancePerformance or resource usagePerformance or resource usage
    on Sep 20, 2024
  2. Eclips4
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Sep 20, 2024
  3. colesbury
    added 2 commits that reference this issue on Sep 24, 2024

    pythongh-124296: Remove private dictionary version tag (PEP 699)

    043db41

    gh-124296: Remove private dictionary version tag (PEP 699) (#124472)

    5aa91c5
  4. colesbury
    closed this as completedon Oct 13, 2024
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)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.