Hi,

On Tue, Apr 5, 2011 at 9:46 AM, Christopher Barker
<chris.bar...@noaa.gov> wrote:
> On 4/4/11 10:35 PM, Charles R Harris wrote:
>>     IIUC, "Ub" is undefined -- "U" means universal newlines, which makes no
>>     sense when used with "b" for binary. I looked at the code a ways back,
>>     and I can't remember the resolution order, but there isn't any checking
>>     for incompatible flags.

I disagree that U makes no sense for binary file reading.

In python 3:

'b' means, "return byte objects"
't' means "return decoded strings"

'U' means two things:

1) When iterating by line, split lines at any of '\r', '\r\n', '\n'
2) When returning lines split this way, convert '\r' and '\r\n' to '\n'

If you support returning lines from a binary file (which python 3
does), then I think 'U' is a sensible thing to allow - as in this
case.

Best,

Matthew
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to