Christopher Welborn added the comment:

Django: 
https://docs.djangoproject.com/en/dev/ref/files/file/#django.core.files.File

It looks like Django has a File object that wraps around Python's built-in file 
object. It offers a 'mode' attribute, and a read(num_bytes=None) / 
write([content]) function. It also offers __iter__ functionality. You must open 
the file, and then wrap it with File() like:

myfile = File(open('myfile.txt', 'r'))


Twisted: 
http://twistedmatrix.com/documents/current/api/twisted.python.filepath.FilePath.html

Looking at twisted.python.filepath.FilePath, it looks like there is no 
read/write.


These are two very popular frameworks/libraries, but I'll see if I can't find 
other sources for inspiration.

I think read_bytes/read_text would offer a good alternative method for reading 
files, instead of trying to create a full-on replacement like the previous 
patches attempt to do.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20218>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to