I hope I can get a better answer here: Why isn't __sub__ defined for the internal strings? I want a good reason for that, and not the "Go C++ if you want to do shit like that" that I got on #python. I mean, it wasn't much code: import UserString class mystr(UserString.UserString): def __init__(self, data=""): self.data = data def __sub__(self, other): return self.data.replace(other, "") >>> s = mystr("foo bar foo foo foo bar") >>> s - "foo" ' bar bar' -- Rikard Bosnjakovic - http://bos.hack.org/cv/ - ICQ: 1158217 Anyone sending unwanted advertising e-mail to my address will be charged $250 for network traffic and computing time. By extracting my address from this message or its header, you agree to these terms.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4