FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-111835: Add seekable method to mmap.mmap by corona10 · Pull Request #111852 · python/cpython · GitHub

/ cpython Public

gh-111835: Add seekable method to mmap.mmap - #111852

Merged
corona10 merged 17 commits into
python:mainfrom
corona10:gh-111835
Nov 9, 2023
Merged

gh-111835: Add seekable method to mmap.mmap#111852
corona10 merged 17 commits into
python:mainfrom
corona10:gh-111835

Conversation

corona10 commented Nov 8, 2023
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

corona10 commented Nov 8, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

@serhiy-storchaka cc @vstinner
As the issue reporter said, they can use seekable by subclassing mmap itself.
But this change definitely helpful to people who need to use library which checks that the file object supports seekable() method.
(I don't want to say it must be added but it is good to be added)

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.

Comment thread Doc/library/mmap.rst Outdated

Copy link
Copy Markdown
Member

mmap.seek() always return None. It can make mmap not appropriate substitution for files. Adding seekable() method can break existing code.

corona10 commented Nov 8, 2023

Copy link
Copy Markdown
Member Author

mmap.seek() always return None. It can make mmap not appropriate substitution for files. Adding seekable() method can break existing code.

I left a comment for this.
#111835 (comment)
But I'm not sure how it will break the user's code even if we update seek() to return the current position.
I can not guess how people are doing something with None value.

Comment thread Doc/library/mmap.rst Outdated
Comment thread Doc/whatsnew/3.13.rst
Comment thread Lib/test/test_mmap.py Outdated
Comment thread Modules/mmapmodule.c Outdated
Comment thread Doc/whatsnew/3.13.rst Outdated

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.

corona10 merged commit 6046aec into python:main Nov 9, 2023

corona10 commented Nov 9, 2023

Copy link
Copy Markdown
Member Author

@serhiy-storchaka @vstinner
Thank you for the reviews!!

corona10 deleted the gh-111835 branch November 9, 2023 11:13
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL