string.replace doesn't removes ":"

Joshua Robinson shooki.robinson at gmail.com
Sat Feb 9 06:04:18 EST 2013


Hi *Monte-Pythons*,

x = "this is a simple : text: that has colon"
s = x.replace(string.punctuation, "");  OR
s = x.replace(string.punctuation, "");
print x   # 'this is a simple : text: that has colon'
# The colon is still in the text !!!!

Is this a bug or am I doing something wrong ?

Py.Version: 2.7
OS: Ubuntu 12.10 (64 bits)

Cheers,
-Joshua
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130209/2684342e/attachment.html>


More information about the Python-list mailing list