[Python-Dev] Decoding incomplete unicode

M.-A. Lemburg mal at egenix.com
Thu Aug 19 22:03:41 CEST 2004


Walter Dörwald wrote:
> M.-A. Lemburg wrote:
> 
>> Walter Dörwald wrote:
>>
>>> Without the feed method(), we need the following:
>>>
>>> 1) A StreamQueue class that
>>>    a) supports writing at one end and reading at the other end
>>>    b) has a method for pushing back unused bytes to be returned
>>>       in the next call to read()
>>
>>
>> Right.
> 
> 
> As already stated in a previous post, I don't think StreamQueue
> needs a pushback() method. trailing bytes should all be stored
> in the StreamReader.

I'd leave that to the StreamReader implementor. I would always
push the data back onto the queue, simply because it's unprocessed
data.

>> It also needs a method giving the number of pending bytes in
>> the queue or just an API .has_pending_data() that returns
>> True/False.
> 
> 
> What would this method be used for?

If you push the data back onto the queue, you will probably want
to check whether there's pending data left. That's what this
method is intended to tell you.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 19 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-Dev mailing list