| | |
- UserString
-
- MutableString
class MutableString(UserString) |
| |
mutable string objects
Python strings are immutable objects. This has the advantage, that
strings may be used as dictionary keys. If this property isn't needed
and you insist on changing string values in place instead, you may cheat
and use MutableString.
But the purpose of this class is an educational one: to prevent
people from inventing their own mutable string class derived
from UserString and than forget thereby to remove (override) the
__hash__ method inherited from ^UserString. This would lead to
errors that would be very hard to track down.
A faster and better solution is to rewrite your program using lists. |
| |
- __add__(self, other) from UserString
- __cmp__(self, string) from UserString
- __complex__(self) from UserString
- __contains__(self, char) from UserString
- __delitem__(self, index)
- __delslice__(self, start, end)
- __float__(self) from UserString
- __getitem__(self, index) from UserString
- __getslice__(self, start, end) from UserString
- __hash__(self)
- __init__(self, string='')
- __int__(self) from UserString
- __len__(self) from UserString
- __long__(self) from UserString
- __mul__(self, n) from UserString
- __radd__(self, other) from UserString
- __repr__(self) from UserString
- __rmul__ = __mul__(self, n) from UserString
- __setitem__(self, index, sub)
- __setslice__(self, start, end, sub)
- __str__(self) from UserString
- capitalize(self) from UserString
- center(self, width) from UserString
- count(self, sub, start=0, end=2147483647) from UserString
- encode(self, encoding=None, errors=None) from UserString
- endswith(self, suffix, start=0, end=2147483647) from UserString
- expandtabs(self, tabsize=8) from UserString
- find(self, sub, start=0, end=2147483647) from UserString
- immutable(self)
- index(self, sub, start=0, end=2147483647) from UserString
- isdecimal(self) from UserString
- isdigit(self) from UserString
- islower(self) from UserString
- isnumeric(self) from UserString
- isspace(self) from UserString
- istitle(self) from UserString
- isupper(self) from UserString
- join(self, seq) from UserString
- ljust(self, width) from UserString
- lower(self) from UserString
- lstrip(self) from UserString
- replace(self, old, new, maxsplit=-1) from UserString
- rfind(self, sub, start=0, end=2147483647) from UserString
- rindex(self, sub, start=0, end=2147483647) from UserString
- rjust(self, width) from UserString
- rstrip(self) from UserString
- split(self, sep=None, maxsplit=-1) from UserString
- splitlines(self, keepends=0) from UserString
- startswith(self, prefix, start=0, end=2147483647) from UserString
- strip(self) from UserString
- swapcase(self) from UserString
- title(self) from UserString
- translate(self, table, deletechars='') from UserString
- upper(self) from UserString
|
class UserString |
| |
|
| |
- __add__(self, other)
- __cmp__(self, string)
- __complex__(self)
- __contains__(self, char)
- __float__(self)
- __getitem__(self, index)
- __getslice__(self, start, end)
- __hash__(self)
- __init__(self, seq)
- __int__(self)
- __len__(self)
- __long__(self)
- __mul__(self, n)
- __radd__(self, other)
- __repr__(self)
- __rmul__ = __mul__(self, n)
- __str__(self)
- capitalize(self)
- # the following methods are defined in alphabetical order:
- center(self, width)
- count(self, sub, start=0, end=2147483647)
- encode(self, encoding=None, errors=None)
- endswith(self, suffix, start=0, end=2147483647)
- expandtabs(self, tabsize=8)
- find(self, sub, start=0, end=2147483647)
- index(self, sub, start=0, end=2147483647)
- isdecimal(self)
- isdigit(self)
- islower(self)
- isnumeric(self)
- isspace(self)
- istitle(self)
- isupper(self)
- join(self, seq)
- ljust(self, width)
- lower(self)
- lstrip(self)
- replace(self, old, new, maxsplit=-1)
- rfind(self, sub, start=0, end=2147483647)
- rindex(self, sub, start=0, end=2147483647)
- rjust(self, width)
- rstrip(self)
- split(self, sep=None, maxsplit=-1)
- splitlines(self, keepends=0)
- startswith(self, prefix, start=0, end=2147483647)
- strip(self)
- swapcase(self)
- title(self)
- translate(self, table, deletechars='')
- upper(self)
| |