[Python-bugs-list] [ python-Bugs-706546 ] u''.translate not documented

SourceForge.net noreply@sourceforge.net
Thu, 20 Mar 2003 06:26:53 -0800


Bugs item #706546, was opened at 2003-03-19 16:35
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=706546&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Martijn Pieters (mjpieters)
Assigned to: Nobody/Anonymous (nobody)
Summary: u''.translate not documented

Initial Comment:
The behaviour of u''.translate is significantly
different from ''.translate, yet the difference is not
reflected in the documentation.

- ''.translate takes one or two arguments, one a table
of 256 characters for the translation target and the
other a string containing characters to be removed.

- u''.translate only takes on argument, which is a
mapping from unicode ordinal to unicode ordinal,
ustring or None.

See also print u''.translate.__doc__

----------------------------------------------------------------------

>Comment By: Martijn Pieters (mjpieters)
Date: 2003-03-20 09:26

Message:
Logged In: YES 
user_id=116747

No, the documentation on u''.translate is *not present*. The
Python Library Reference makes no mention of a difference. See:

  http://www.python.org/doc/current/lib/string-methods.html

I don't really care how it is of little use, I just need the
documentation to be up to date so I don't have to scratch my
head why I get this weird error that translate only takes
one argument; as it turns out the strings I was calling this
on were unicode strings.

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2003-03-20 04:15

Message:
Logged In: YES 
user_id=38388

Isn't the documentation clear enough about the difference ?

Note that u.translate() is not really all that useful. You
are much
better off with writing your own charmap based codec which
is not really difficult: just take a look at e.g. cp1251.py.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=706546&group_id=5470