You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mmap.mmap has a seek() method, but no seekable() method. Because of this, it cannot be used an argument for ZipFile, which requires a file-like object with seekable. A small patch is enough to fix this
mmap.seek() returns None. The seek() method of other file-like objects return the new file position. Would not it cause issues?
Yeah, in that case, we can make a seek() method to return where value. It will break the user's code actually?
In my naive idea, people cannot do something with None value.
Activity
[-]mmap doesn't have a seekable method[/-][+]Add `seekable` method for `mmap.mmap`[/+]pythongh-111835: Add seekable method to mmap.mmap
pythongh-111835: Add seekable method to mmap.mmap
Merge branch 'main' into pythongh-111835
Merge remote-tracking branch 'origin/pythongh-111835' into pythongh-1…
serhiy-storchaka commentedon Nov 8, 2023
mmap.seek()returns None. Theseek()method of other file-like objects return the new file position. Would not it cause issues?pythongh-111835: Add seekable method to mmap.mmap
technillogue commentedon Nov 8, 2023
I also opened a PR #111865 for this, I just took a while between pushing the code and opening the PR.
corona10 commentedon Nov 8, 2023
Yeah, in that case, we can make a seek() method to return where value. It will break the user's code actually?
In my naive idea, people cannot do something with None value.
gh-111835: Add seekable method to mmap.mmap (gh-111852)
corona10 commentedon Nov 9, 2023
@technillogue
#111852 is landed, this feature will be available from CPython 3.13
Thanks for the suggestion!
@serhiy-storchaka @vstinner
Thanks for your valuable feedback and reviews!
pythongh-111835: Add seekable method to mmap.mmap (pythongh-111852)
pythongh-111835: Add seekable method to mmap.mmap (pythongh-111852)