[Python-ideas] Proposing new file-like object methods

Arek Bulski arek.bulski at gmail.com
Mon Aug 1 20:12:12 EDT 2016


I would like to see few methods added to file() objects:

- read(size, *, offset=None)  so os.pread() be used going around file description position 
- write(data, *, offset=None)  analog os.pwrite()
- flush(sync=False)  so os.fsync(f.fileno()) can optionally follow

For text files, offset would probably be not supported or count in characters. New methods could be added like readp/writep/fsync instead of modifying current methods, its debatable.

Please tell me how to go about pushing this mainstream.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160802/87728263/attachment.html>


More information about the Python-ideas mailing list