[python-tulip] StreamReader.readline() limit

2014-02-20 Thread Victor Stinner
Hi,

StreamReader.read() can reed unlimited data, but
StreamReader.readline() is limited by the limit paramter of the
StreamReader constructor. It is not possible to pass None. Is there a
reason for that?

Victor


Re: [python-tulip] Interacting with sys.stdin/sys.stdout/sys.stderr

2014-02-20 Thread Victor Stinner
2014-02-20 8:57 GMT+01:00 Jonathan Slenders jonathan.slend...@gmail.com:
 Thanks, the example is very clear and helpful!

Sorry, but I didn't understand your opinion on the patch. Does it look
correct? It just found a new issue with the non-blocking mode when the
cat program is used as input. IMO the pipe should not be set to
non-blocking if it's a TTY.

The worst case with my patch would be that the write protocol is not
notified immediatly when the PTY is closed or if the file descriptor
is closed, but only at the next write.

Or would it be better to use a duplex pipe transport for PTY?

Victor


Re: [python-tulip] Re: Tulip third-party projects and Trollius

2014-02-20 Thread Yury Selivanov


On 2/20/2014, 12:54 PM, Guido van Rossum wrote:

The source transformation route has not been very popular with Python 2 vs.
3 porting projects.

It's not popular, but nevertheless, many use it just fine.


I wonder if it would be possible (using asyncio internals) to write a
From() function that lets you write yield From(x) instead of yield from
x in Tulip?


I think it's doable. Although, I'm not sure we should include
this in asyncio, as we either should encourage people to use
'yield From' in asyncio and python3, or we'll end up with half
code using one form, and half using another.

Yury


Re: [python-tulip] Re: Tulip third-party projects and Trollius

2014-02-20 Thread Guido van Rossum
It should not be part of asyncio, but a separate library on PyPI, like six.


On Thu, Feb 20, 2014 at 10:31 AM, Yury Selivanov yselivanov...@gmail.comwrote:


 On 2/20/2014, 12:54 PM, Guido van Rossum wrote:

 The source transformation route has not been very popular with Python 2
 vs.
 3 porting projects.

 It's not popular, but nevertheless, many use it just fine.


  I wonder if it would be possible (using asyncio internals) to write a
 From() function that lets you write yield From(x) instead of yield from
 x in Tulip?


 I think it's doable. Although, I'm not sure we should include
 this in asyncio, as we either should encourage people to use
 'yield From' in asyncio and python3, or we'll end up with half
 code using one form, and half using another.

 Yury




-- 
--Guido van Rossum (python.org/~guido)