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 — gh-142419: Add mmap.set_name method for user custom annotation by corona10 · Pull Request #142480 · python/cpython

Conversation

@corona10

@corona10 corona10 commented Dec 9, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Expose annotation to anonymous virtual memory ranges to mmap module #142419

📚 Documentation preview 📚: https://cpython-previews--142480.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
corona10 added 7 commits December 10, 2025 01:32
@corona10
pythongh-142419: Add mmap.set_name method for annotation
f19909e
@corona10
Merge remote-tracking branch 'upstream/main' into pythongh-142419
c65e691
@corona10
nit
d354eba
@corona10
nit
91d4aea
@corona10
Add test
5919851
@corona10
Update Docs
6c13efc
@corona10
Update
5586acd
@corona10
corona10 requested a review from AA-Turner as a code owner December 9, 2025 17:32
@corona10
corona10 requested review from vstinner and removed request for AA-Turner December 9, 2025 17:32
@bedevere-app bedevere-app Bot added the awaiting core review label Dec 9, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Dec 9, 2025
Expose annotation to anonymous virtual memory ranges to mmap module #142419
Closed
@corona10
corona10 requested a review from picnixz December 9, 2025 17:32
corona10 added 4 commits December 10, 2025 02:34
@corona10
nit
73ac4b9
@corona10
nit
a931201
@corona10
lint
831bd7e
@corona10
nit
c7185f0
@corona10
corona10 requested a review from encukou December 10, 2025 00:09
picnixz
picnixz reviewed Dec 10, 2025
View reviewed changes
Comment thread Doc/library/mmap.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mmapmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mmapmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/mmap.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/mmap.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/mmap.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.15.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_mmap.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mmapmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed Dec 10, 2025
View reviewed changes
Comment thread Modules/mmapmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_mmap.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

corona10 and others added 4 commits December 11, 2025 02:41
@corona10 @picnixz
Apply suggestions from code review
3a2654d
Co-authored-by: Bénédikt Tran <[email protected]>
@corona10 @picnixz
Update Doc/library/mmap.rst
cc3cf8a
Co-authored-by: Bénédikt Tran <[email protected]>
@corona10
Address code review
bd02cc5
@corona10
Addrss code review
fa52b0e
@corona10

corona10 commented Dec 10, 2025

Copy link
Copy Markdown
Member Author

@picnixz @vstinner PTAL :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@corona10
fix
73bf762
@corona10
corona10 requested a review from picnixz December 11, 2025 01:23
@corona10
nit
94d0268
vstinner
vstinner reviewed Dec 11, 2025
View reviewed changes
Comment thread Lib/test/test_mmap.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed Dec 11, 2025
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2025-12-10-02-31-43.gh-issue-142419.C8_LES.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@corona10
Fix test
ca4bcec
@corona10
corona10 requested review from picnixz and vstinner December 11, 2025 19:29
vstinner
vstinner reviewed Dec 12, 2025
View reviewed changes
Comment thread Doc/library/mmap.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/mmap.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.15.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_mmap.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mmapmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mmapmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_mmap.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

corona10 and others added 3 commits December 13, 2025 18:44
@corona10 @vstinner
Apply suggestions from code review
987cf09
Co-authored-by: Victor Stinner <[email protected]>
@corona10
Address code review
2a5d9a4
@corona10 @vstinner
Update Modules/mmapmodule.c
9adcf8e
Co-authored-by: Victor Stinner <[email protected]>
@corona10
corona10 requested a review from vstinner December 13, 2025 09:53
@vstinner

vstinner commented Dec 13, 2025

Copy link
Copy Markdown
Member

@picnixz: What do you think of not adding cpython:mmap: prefix? set_name("abc") would sets the memory mapping name to [abc].

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Dec 13, 2025

Copy link
Copy Markdown
Member

Personally, I think we should at least indicate cpython. As I don't have a kernel recent enough, I can't test this, but I guess that seeing "cpython" could help users grepping for whatever is related to cpython. I don't think we really need :mmap though but it could help distinguishing between what's been created from the interpreter directly and what's been created by a direct call to mmap. We could instead have cpython:<name> prefix for the interpreter and cpython:[<name>] for what's being used by mmap.

Is it because you're worried about the allowed length? or something else?

corona10 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@corona10
Fix
522ef49
@corona10

corona10 commented Dec 14, 2025

Copy link
Copy Markdown
Member Author

Personally, I think we should at least indicate cpython. As I don't have a kernel recent enough, I can't test this, but I guess that seeing "cpython" could help users grepping for whatever is related to cpython. I don't think we really need :mmap though but it could help distinguishing between what's been created from the interpreter directly and what's been created by a direct call to mmap. We could instead have cpython: prefix for the interpreter and cpython:[] for what's being used by mmap.

@vstinner @picnixz

I still prefer to keep the current convention as much as possible. As Bénédikt mentioned, having a common prefix is important for filtering.

Regarding using different conventions for CPython-defined versus user-defined mappings, I would prefer not to introduce additional distinctions that people need to learn or interpret. Keeping things simple and consistent feels more important here.

For that reason, my preference is to maintain the same convention across the board.

If there is no strong objection with this, I hope that I can merge this PR soon.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner approved these changes Dec 15, 2025
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/mmap.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/mmap.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Dec 15, 2025
@vstinner

vstinner commented Dec 15, 2025

Copy link
Copy Markdown
Member

Ok, let's add the cpython:mmap: prefix.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@corona10 @vstinner
Apply suggestions from code review
13138d9
Co-authored-by: Victor Stinner <[email protected]>
picnixz
picnixz reviewed Dec 15, 2025
View reviewed changes
Comment thread Doc/library/mmap.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mmapmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mmapmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

corona10 and others added 4 commits December 16, 2025 02:32
@corona10 @picnixz
Apply suggestions from code review
2ece41b
Co-authored-by: Bénédikt Tran <[email protected]>
@corona10
Update
cf96361
@vstinner
Report error to the caller
0b7eac3
@corona10
Merge pull request #65 from vstinner/pythongh-142419
c78537b
Report error to the caller
@corona10
corona10 requested review from brandtbucher, diegorusso and savannahostrowski as code owners December 17, 2025 14:13
@corona10

corona10 commented Dec 17, 2025

Copy link
Copy Markdown
Member Author

@picnixz I think that we are ready to land this feature :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@corona10
corona10 requested a review from picnixz December 17, 2025 15:05
@corona10
corona10 merged commit 14f0b51 into python:main Dec 18, 2025
64 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Dec 18, 2025
cocolato pushed a commit to cocolato/cpython that referenced this pull request Dec 18, 2025
@corona10 @cocolato
pythongh-142419: Add mmap.set_name method for user custom annotation (p…
7f36dd3
…ythongh-142480)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@encukou encukou Awaiting requested review from encukou
@brandtbucher brandtbucher Awaiting requested review from brandtbucher brandtbucher is a code owner
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski
@diegorusso diegorusso Awaiting requested review from diegorusso diegorusso is a code owner
@picnixz picnixz Awaiting requested review from picnixz

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@corona10 @vstinner @picnixz @encukou
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.