Re: Why does the "".jo in(r) do this?
Peter Otten <__peter__@web. de> wrote:[color=blue]
> Of course it would fail with non-ascii characters in the string that shall
> be converted. Why not allow strings with all 256 chars? Again, as stated in
> my above post, that would be ambiguous:
>[/color]
Thanks, Peter and others, you have been enlightening. I understand
you to say that Python insists that I explicitly decide the decoding,
and not just smoosh the strings. Thanks.
I will write to the documentation person with the suggestion that the
documentation of .join(seq) at
http://docs.python.org/lib/string-methods.html#l2h-188 might be
updated from:
"Return a string which is the concatenation of the strings in the
sequence seq."[color=blue][color=green][color=darkred]
> >> Use either unicode or str, but don't mix them. That should keep you out
> >> of trouble.[/color][/color]
>
> Or make all conversions explicit with the str.decode()/unicode.encode( )
> methods.[/color]
Now I only have to figure out whic codec's are available and
appropriate.
Thanks again,
Jim
Peter Otten <__peter__@web. de> wrote:[color=blue]
> Of course it would fail with non-ascii characters in the string that shall
> be converted. Why not allow strings with all 256 chars? Again, as stated in
> my above post, that would be ambiguous:
>[/color]
Thanks, Peter and others, you have been enlightening. I understand
you to say that Python insists that I explicitly decide the decoding,
and not just smoosh the strings. Thanks.
I will write to the documentation person with the suggestion that the
documentation of .join(seq) at
http://docs.python.org/lib/string-methods.html#l2h-188 might be
updated from:
"Return a string which is the concatenation of the strings in the
sequence seq."[color=blue][color=green][color=darkred]
> >> Use either unicode or str, but don't mix them. That should keep you out
> >> of trouble.[/color][/color]
>
> Or make all conversions explicit with the str.decode()/unicode.encode( )
> methods.[/color]
Now I only have to figure out whic codec's are available and
appropriate.
Thanks again,
Jim
Comment