Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Removema_version_tag (PEP 699 / PEP 509) #124296

Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-featureA feature request or enhancement
@colesbury

Description

@colesbury

Feature or enhancement

The acceptedPEP 699 proposed removing the privatema_version_tag field fromPyDictObject. Note that PEP 699 supersedesPEP 509, which originally proposed the field.

Why now?

  • Thema_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'sbackward compatibility policy from PEP 387.
  • Cython and PyTorch (dynamo) andNuitka have stopped using it for CPython 3.12+. I don't thinkma_version_tag ever saw widespread usage. Cython was the major user mentioned in PEP 699.1
  • I think thema_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 inReference 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

Thema_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

Footnotes

  1. I searched thetop ~7500 sdists as well. The only other actual usage I saw washttps://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).

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp