UserString
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserString.py
Module Docs

A user-defined wrapper around string objects
 
Note: string objects have grown methods in Python 1.6
This module requires Python 1.6 or later.

 
Modules
       
collections
sys

 
Classes
       
_abcoll.Sequence(_abcoll.Sized, _abcoll.Iterable, _abcoll.Container)
UserString
MutableString(UserString, _abcoll.MutableSequence)

 
class MutableString(UserString, _abcoll.MutableSequence)
    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.
 
 
Method resolution order:
MutableString
UserString
_abcoll.MutableSequence
_abcoll.Sequence
_abcoll.Sized
_abcoll.Iterable
_abcoll.Container
__builtin__.object

Methods defined here:
__delitem__(self, index)
__delslice__(self, start, end)
__iadd__(self, other)
__imul__(self, n)
__init__(self, string='')
__setitem__(self, index, sub)
__setslice__(self, start, end, sub)
immutable(self)
insert(self, index, value)

Data and other attributes defined here:
__abstractmethods__ = frozenset([])
__hash__ = None

Methods inherited from UserString:
__add__(self, other)
__cmp__(self, string)
__complex__(self)
__contains__(self, char)
__float__(self)
__getitem__(self, index)
__getslice__(self, start, end)
__int__(self)
__len__(self)
__long__(self)
__mod__(self, args)
__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, *args)
count(self, sub, start=0, end=9223372036854775807)
decode(self, encoding=None, errors=None)
encode(self, encoding=None, errors=None)
endswith(self, suffix, start=0, end=9223372036854775807)
expandtabs(self, tabsize=8)
find(self, sub, start=0, end=9223372036854775807)
index(self, sub, start=0, end=9223372036854775807)
isalnum(self)
isalpha(self)
isdecimal(self)
isdigit(self)
islower(self)
isnumeric(self)
isspace(self)
istitle(self)
isupper(self)
join(self, seq)
ljust(self, width, *args)
lower(self)
lstrip(self, chars=None)
partition(self, sep)
replace(self, old, new, maxsplit=-1)
rfind(self, sub, start=0, end=9223372036854775807)
rindex(self, sub, start=0, end=9223372036854775807)
rjust(self, width, *args)
rpartition(self, sep)
rsplit(self, sep=None, maxsplit=-1)
rstrip(self, chars=None)
split(self, sep=None, maxsplit=-1)
splitlines(self, keepends=0)
startswith(self, prefix, start=0, end=9223372036854775807)
strip(self, chars=None)
swapcase(self)
title(self)
translate(self, *args)
upper(self)
zfill(self, width)

Methods inherited from _abcoll.MutableSequence:
append(self, value)
S.append(object) -- append object to the end of the sequence
extend(self, values)
S.extend(iterable) -- extend sequence by appending elements from the iterable
pop(self, index=-1)
S.pop([index]) -> item -- remove and return item at index (default last).
Raise IndexError if list is empty or index is out of range.
remove(self, value)
S.remove(value) -- remove first occurrence of value.
Raise ValueError if the value is not present.
reverse(self)
S.reverse() -- reverse *IN PLACE*

Methods inherited from _abcoll.Sequence:
__iter__(self)
__reversed__(self)

Class methods inherited from _abcoll.Sized:
__subclasshook__(cls, C) from abc.ABCMeta

Data descriptors inherited from _abcoll.Sized:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _abcoll.Sized:
__metaclass__ = <class 'abc.ABCMeta'>
Metaclass for defining Abstract Base Classes (ABCs).
 
Use this metaclass to create an ABC.  An ABC can be subclassed
directly, and then acts as a mix-in class.  You can also register
unrelated concrete classes (even built-in classes) and unrelated
ABCs as 'virtual subclasses' -- these and their descendants will
be considered subclasses of the registering ABC by the built-in
issubclass() function, but the registering ABC won't show up in
their MRO (Method Resolution Order) nor will method
implementations defined by the registering ABC be callable (not
even via super()).

 
class UserString(_abcoll.Sequence)
    
Method resolution order:
UserString
_abcoll.Sequence
_abcoll.Sized
_abcoll.Iterable
_abcoll.Container
__builtin__.object

Methods defined here:
__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)
__mod__(self, args)
__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, *args)
count(self, sub, start=0, end=9223372036854775807)
decode(self, encoding=None, errors=None)
encode(self, encoding=None, errors=None)
endswith(self, suffix, start=0, end=9223372036854775807)
expandtabs(self, tabsize=8)
find(self, sub, start=0, end=9223372036854775807)
index(self, sub, start=0, end=9223372036854775807)
isalnum(self)
isalpha(self)
isdecimal(self)
isdigit(self)
islower(self)
isnumeric(self)
isspace(self)
istitle(self)
isupper(self)
join(self, seq)
ljust(self, width, *args)
lower(self)
lstrip(self, chars=None)
partition(self, sep)
replace(self, old, new, maxsplit=-1)
rfind(self, sub, start=0, end=9223372036854775807)
rindex(self, sub, start=0, end=9223372036854775807)
rjust(self, width, *args)
rpartition(self, sep)
rsplit(self, sep=None, maxsplit=-1)
rstrip(self, chars=None)
split(self, sep=None, maxsplit=-1)
splitlines(self, keepends=0)
startswith(self, prefix, start=0, end=9223372036854775807)
strip(self, chars=None)
swapcase(self)
title(self)
translate(self, *args)
upper(self)
zfill(self, width)

Data and other attributes defined here:
__abstractmethods__ = frozenset([])

Methods inherited from _abcoll.Sequence:
__iter__(self)
__reversed__(self)

Class methods inherited from _abcoll.Sized:
__subclasshook__(cls, C) from abc.ABCMeta

Data descriptors inherited from _abcoll.Sized:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _abcoll.Sized:
__metaclass__ = <class 'abc.ABCMeta'>
Metaclass for defining Abstract Base Classes (ABCs).
 
Use this metaclass to create an ABC.  An ABC can be subclassed
directly, and then acts as a mix-in class.  You can also register
unrelated concrete classes (even built-in classes) and unrelated
ABCs as 'virtual subclasses' -- these and their descendants will
be considered subclasses of the registering ABC by the built-in
issubclass() function, but the registering ABC won't show up in
their MRO (Method Resolution Order) nor will method
implementations defined by the registering ABC be callable (not
even via super()).

 
Data
        __all__ = ['UserString', 'MutableString']