while c = f.read(1)

Robert Kern rkern at ucsd.edu
Tue Aug 23 03:53:24 CEST 2005


John Hunter wrote:
>>>>>>"Robert" == Robert Kern <rkern at ucsd.edu> writes:
> 
>     Robert> Greg McIntyre wrote:
>     >> The 2nd option has real potential for me. Although the total
>     >> amount of code is greater, it factors out some complexity away
>     >> from the actual job, so that code is not obscured by
>     >> unnecessary compexity. IMHO that's great practice.
> 
>     Robert> Please quote the message you are replying to. We have no
>     Robert> idea what "the 2nd option" is.
> 
> I think he means the second option you presented
> 
>   If you must read one character at a time,
> 
>      def reader(fileobj, blocksize=1):
>          """Return an iterator that reads blocks of a given size from a
>          file object until EOF.
>          ...snip
> 
> With a decent threaded news/mail reader, the thread provides
> sufficient context, no?

Not taking into account the python-list gateway or GMane. I see his
message threaded directly under his original one.

And dammit, I'm vain enough that if people are complimenting my code, I
want to be sure about it.  ;-)

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Python-list mailing list