[issue3284] Delete obsolete 'Unicode' in Py3 str docstrings; related fixes

Terry J. Reedy report at bugs.python.org
Fri Jul 4 21:26:09 CEST 2008


New submission from Terry J. Reedy <tjreedy at udel.edu>:

In 3.0b1, several str methods have 'Unicode' in their docstrings
leftover from 2.x when str *was* unicode.

For
  center
  count
  ljust
  rjust
  translate
'Unicode' should be deleted before 'string'.
For 'translate', I presume 'Unicode ordinal' should be left as is as was
done for 'maketrans'.

For
  lstrip
  rstrip
  strip
"If chars is a str, it will be converted to unicode before stripping"
should be deleted.  Bytes (which replace old str) and bytearrays are not
automatically converted.

Other fixes

For
  maketrans
the word 'then' should be removed from 'will then be' in the fourth line
since it only confuses.  The conversion is the first and only thing done
in the one-argument case.

For
  lstrip
  rstrip
  strip
remove ', Unicode' from
"TypeError: <x>strip arg must be None, unicode or str"

For
  ljust
  rjust
"TypeError: The fill character cannot be converted to Unicode"
should be changed to
TypeError: The fill character cannot be implicitly converted to str"
or even, copying from several other method error messages
TypeError: Can't convert 'bytes' object to str implicitly"
or perhaps best would be
"TypeError: For the fill char, can't convert 'bytes' object to str
implicitly"

The other methods taking str args seem to have been updated already.

----------
assignee: georg.brandl
components: Documentation
keywords: easy
messages: 69263
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: Delete obsolete 'Unicode' in Py3 str docstrings; related fixes
versions: Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3284>
_______________________________________


More information about the Python-bugs-list mailing list