Jesus Cea wrote:

How do you differenciate between that empty string (when doing
"read(0)"), from EOF (that is signaled by an empty string)?.

If you need to be able to make that distinction, then
you have to be careful not to try to read 0 bytes.

Personally I've never come across a situation where
allowing read(0) to occur would have simplified the
code. In the usual keep-reading-until-we've-got-the-
required-number-of-bytes scenario, you're checking
for 0 bytes left to read in order to tell when to
stop.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to