[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2016-09-19 Thread Christian Heimes

Christian Heimes added the comment:

In C programming common names for both ends are reader and writer. We could go 
with the pipes analogy and call the ends inlet and outlet.

--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-07-21 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
nosy:  -ethan.furman

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-07-17 Thread Martin Panter

Martin Panter added the comment:

The original Python-ideas thread: https://www.marc.info/?t=14355895454

If you want shorter field names, how about just r and w (as they are currently 
documented)?

os.write(our_pipe.w, bdata)
os.read(our_pipe.r, 1024)

“Input” and “output” would also work for me (though I am also happy with read, 
read_fd, etc). However it does seem a bit novel; in my experience people tend 
to say pipes have read and write ends, not inputs and outputs.

os.write(our_pipe.input, bdata)
os.read(our_pipe.output, 1024)

--
nosy: +vadmium
type:  - enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-07-01 Thread Ethan Furman

Ethan Furman added the comment:

Nowhere else in the stdlib is 'readfd' defined, and 'writefd' is only used once 
in a test.

I think tacking on the 'fd' is both too low level as well as misleading since 
these are not file descriptors.

If there is no agreement on read/write (understandable since those are usually 
methods), then perhaps input/output?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-07-01 Thread Ethan Furman

Ethan Furman added the comment:

Okay, scratch the not file descriptors part of my comment, but the rest still 
stands.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-07-01 Thread Ethan Furman

Ethan Furman added the comment:

As for Niki's example:
-
-- src = os.pipe()
-- src
(3, 4)
-- if not hasattr(src, 'read'): src = open(src)
... 
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: invalid file: (3, 4)


This fails now.  If they pass a pipe tuple into the new code they'll just get a 
different error somewhere else, which seems fine to me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-06-30 Thread Chris Angelico

Chris Angelico added the comment:

Another good option is read/write without the 'fd' suffix. Either works, I'd 
prefer the shorter one but by a small margin.

--
nosy: +Rosuav

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-06-30 Thread Jonathan Slenders

New submission from Jonathan Slenders:

As discussed on python-ideas, os.pipe should return a structsequence instead of 
a plain tuple.

To be decided is the naming for the read and write end.
Personally, I'm in favour of using readfd/writefd.

 our_pipe = pipe()
 os.write(our_pipe.writefd, b'data')
 os.read(our_pipe.readfd, 1024)

--
components: IO
messages: 245980
nosy: jonathan.slenders
priority: normal
severity: normal
status: open
title: os.pipe() should return a structsequence (or namedtuple.)
versions: Python 3.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-06-30 Thread Yury Selivanov

Yury Selivanov added the comment:

+1 for readfd/writefd.  I think 'fd' suffix is necessary to make it explicit 
that those aren't file objects.

--
nosy: +yselivanov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-06-30 Thread Yury Selivanov

Yury Selivanov added the comment:

Here's a patch, please review.

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file39839/ospipe.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com




[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-06-30 Thread Jonathan Slenders

Jonathan Slenders added the comment:

Niki Spahiev made a valid argument saying that the following code is common:

if not hasattr(src, 'read'): src = open(src)

This will break if we name it 'read'/'write'  like the methods of a file object.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-06-30 Thread Ethan Furman

Ethan Furman added the comment:

'read'/'write' is sufficient.

+1 for the proposal.

--
nosy: +ethan.furman

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24536
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com