string.split() documentation incorrect?

Jerry Seutter jerry.seutter at pason.com
Fri Apr 11 15:04:38 EDT 2003


Doh, I had never realized that this was there.  I've been maintaining
Python 1.6 code and it wasn't used or wasn't available.

Bad code breeds more bad code.  Thank you.

Jerry Seutter

On Fri, Apr 11, 2003 at 09:39:00AM -0700, carroll at tjc.com wrote:
> However, use of the string module is deprecated in favor of methods of
> the string class, which work as documented.  The string module only
> calls the equivalent class method anyway, e.g., string.strip(s) turns
> into s.strip().
> 
> Save yourself some trouble and use the class method directly, e.g.,
> instead of these:
> 
>  >>> string.strip(s,",")
>  >>> string.strip("id INT NOT NULL,",",")
> 
> use these:
> 
>  >>> s.strip(",")
>  >>> "id INT NOT NULL,".strip(",")
> 





More information about the Python-list mailing list