This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nirai
Recipients lucifer, nirai, pitrou
Date 2010-01-05.07:10:36
SpamBayes Score 1.1174779e-05
Marked as misclassified No
Message-id <1262675439.34.0.299587289481.issue7610@psf.upfronthosting.co.za>
In-reply-to
Content
> Thank you. Are you sure the "Shortcut common case" in readline() 
> is useful? BufferedIOBase.readline() in itself should be rather fast.

On my dataset the shortcut speeds up readline() 400% on top of the default C implementation. 

I can take a look to why the C implementation is slow (although it is documented as "slowish").

> Also, I'm not sure what happens in readline() in universal mode when 
> the chunk ends with a '\r' and there's a '\n' in the following chunk 
> (see the "ugly check" that your patch removes). Is there a test for that?

The regular pattern returns either a line chunk or a newline (sequence) but not both. To read a line there is therefore a minimum of two peek() calls. One for the line content and the last for the newline. Since the peek is called with a value of 2, the newline sequence \r\n should be retrieved as is. There is no test for that.
History
Date User Action Args
2010-01-05 07:10:39niraisetrecipients: + nirai, pitrou, lucifer
2010-01-05 07:10:39niraisetmessageid: <1262675439.34.0.299587289481.issue7610@psf.upfronthosting.co.za>
2010-01-05 07:10:37nirailinkissue7610 messages
2010-01-05 07:10:36niraicreate