
I created an issue: http://bugs.python.org/issue24536 readfd/writefd sounds like a good choice, but it's still open for discussion. 2015-06-30 9:11 GMT+02:00 Nathaniel Smith <njs@pobox.com>:
On Tue, Jun 30, 2015 at 12:03 AM, Chris Angelico <rosuav@gmail.com> wrote:
On Tue, Jun 30, 2015 at 5:02 PM, Jonathan Slenders <jonathan@slenders.be> wrote:
If we use "read" and write as names. It means that often we end up writing code like this:
os.write(our_pipe.write, data) os.read(our_pipe.read)
Is that ok? I mean, it's not confusing that the os.read is a method, while pip.read is an attribute.
I'd much rather that than the converse. You always put read with read, you always put write with write.
It also appears to be the way that everyone is already naming their variables:
https://codesearch.debian.net/perpackage-results/os%5C.pipe%20filetype%3Apyt...
I see returns named "r, w", "rout, wout", "rfd, wfd", "rfd, self.writepipe", "readfd, writefd", "p2cread, p2cwrite", etc.
Maybe readfd/writefd or read_fileno/write_fileno would be a little better than plain read/write, both to remind the user that these are fds rather than file objects and to make the names nouns instead of verbs. But really read/write is fine too.
-n
-- Nathaniel J. Smith -- http://vorpus.org _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/