[Python-ideas] Make os.pipe() return a namedtuple.
jonathan at slenders.be
Tue Jun 30 09:22:24 CEST 2015
I created an issue:
readfd/writefd sounds like a good choice, but it's still open for
2015-06-30 9:11 GMT+02:00 Nathaniel Smith <njs at pobox.com>:
> On Tue, Jun 30, 2015 at 12:03 AM, Chris Angelico <rosuav at gmail.com> wrote:
> > On Tue, Jun 30, 2015 at 5:02 PM, Jonathan Slenders <jonathan at slenders.be>
> >> If we use "read" and write as names. It means that often we end up
> >> 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,
> >> 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
> 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.
> Nathaniel J. Smith -- http://vorpus.org
> Python-ideas mailing list
> Python-ideas at python.org
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas