Hi,

Is there a (use case) difference between codecs.open and io.open? What is the 
difference?
A small difference that I just discovered is that codecs.open(somefile).read() 
returns a bytestring if no encoding is specified*), but a unicode string if an 
encoding is specified. io.open always returns a unicode string.

*) I had never tried that before. I would have expected that encoding would 
default to e.g locale.getpreferredencoding().


Thank you!

Regards,

Albert-Jan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All right, but apart from the sanitation, the medicine, education, wine, public 
order, irrigation, roads, a 

fresh water system, and public health, what have the Romans ever done for us?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to