Stefan Rank wrote:
> Well, originally, I would have expected it to return a byte str(ing),
I'd assume unicode in, unicode out, and str in, str out, but since it's
always going to produce ASCII-range characters, it wouldn't matter.
Moot point anyway.
> BUT
> I am now converted and think it is best to raise a TypeError for
> unicode, and leave the encoding decisions to higher level code.
>
> So I'll repeat the "patch" #1, slightly modified::
>
> if isinstance(s, unicode):
> raise TypeError("quote expects an encoded byte string as argument")
>
> Is it safe to assume that code that breaks because of this change was
> already broken?
Yes. The patch seems fine to me, although maybe
if not isinstance(s, str)
would be better?
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com