[Python-Dev] difference between diff string implementations

Guido van Rossum guido at python.org
Sun Mar 16 05:29:10 CET 2008

On Sat, Mar 15, 2008 at 5:54 PM, Neal Norwitz <nnorwitz at gmail.com> wrote:
> This inconsistency goes back to 2.3 at least and probably to the
>  initial unicode implementation.
>  >>> set(dir(u'')) - set(dir(''))
>  ['isnumeric', 'isdecimal']
>  UserString contains these two methods even though 8-bit strings do
>  not.  I'm not sure what we should do for 2.6 or 3.0.  My preference
>  would be to remove these methods on unicode/UserString if they aren't
>  useful to a large audience.  However, removing for 2.6 without a
>  deprecation seems bad.
>  Suggestions?

It looks like they all denote different character classes though. I'd
be inclined to keep the status quo in 2.6; the inconsistency will
disappear in 3.0 (I don't think we need to add them to bytes).

They should be documented though.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list