[Python-Dev] Re: [Patches] [Patch #102955] bltinmodule.c warning fix

Tim Peters tim.one@home.com
Thu, 21 Dec 2000 02:44:19 -0500


[Andrew Kuchling]
> Is it OK to refer to 8-bit strings under that name?
> How about "expected an 8-bit string or Unicode string", when the
> object passed to ord() isn't of the right type.
>
> Similarly, when the value is of the right type but has length>1,
> the message is "ord() expected a character, length-%d string found".
> Should that be "length-%d (string / unicode) found)"
>
> And should the type names be changed to '8-bit string'/'Unicode
> string', maybe?

Actually, upon reflection I think it was a mistake to add all these "or
Unicode" clauses to the error msgs to begin with.  Python used to have only
one string type, we're saying that's also a hope for the future, and in the
meantime I know I'd have no trouble understanding "string" as including both
8-bit strings and Unicode strings.

So we should say "8-bit string" or "Unicode string" when *only* one of those
is allowable.  So

    "ord() expected string ..."

instead of (even a repaired version of)

    "ord() expected string or Unicode character ..."

but-i'm-not-even-motivated-enough-to-finish-this-sig-