Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Private Attributes
collections.UserString Class Reference
Inheritance diagram for collections.UserString:
Inheritance graph
[legend]
Collaboration diagram for collections.UserString:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __str__
def __repr__
def __int__
def __float__
def __complex__
def __hash__
def __eq__
def __ne__
def __lt__
def __le__
def __gt__
def __ge__
def __contains__
def __len__
def __getitem__
def __add__
def __radd__
def __mul__
def __mod__
def capitalize
def center
def count
def encode
def endswith
def expandtabs
def find
def format
def index
def isalpha
def isalnum
def isdecimal
def isdigit
def isidentifier
def islower
def isnumeric
def isspace
def istitle
def isupper
def join
def ljust
def lower
def lstrip
def partition
def replace
def rfind
def rindex
def rjust
def rpartition
def rstrip
def split
def rsplit
def splitlines
def startswith
def strip
def swapcase
def title
def translate
def upper
def zfill
def __iter__
def __reversed__
def index
def count
def __subclasshook__
def __subclasshook__
def __subclasshook__
def __new__
def __new__
def __new__
def register
def register
def register
def __instancecheck__
def __instancecheck__
def __instancecheck__
def __subclasscheck__
def __subclasscheck__
def __subclasscheck__

Public Attributes

 data

Static Private Attributes

 __rmul__ = __mul__

Detailed Description

Definition at line 905 of file collections.py.


Constructor & Destructor Documentation

def collections.UserString.__init__ (   self,
  seq 
)

Definition at line 906 of file collections.py.

00906 
00907     def __init__(self, seq):
00908         if isinstance(seq, str):
00909             self.data = seq
00910         elif isinstance(seq, UserString):
00911             self.data = seq.data[:]
00912         else:
            self.data = str(seq)

Here is the caller graph for this function:


Member Function Documentation

def collections.UserString.__add__ (   self,
  other 
)

Definition at line 952 of file collections.py.

00952 
00953     def __add__(self, other):
00954         if isinstance(other, UserString):
00955             return self.__class__(self.data + other.data)
00956         elif isinstance(other, str):
00957             return self.__class__(self.data + other)
        return self.__class__(self.data + str(other))

Here is the caller graph for this function:

Definition at line 917 of file collections.py.

00917 
    def __complex__(self): return complex(self.data)
def collections.UserString.__contains__ (   self,
  char 
)

Reimplemented from _abcoll.Sequence.

Definition at line 945 of file collections.py.

00945 
00946     def __contains__(self, char):
00947         if isinstance(char, UserString):
00948             char = char.data
00949         return char in self.data

def collections.UserString.__eq__ (   self,
  string 
)

Definition at line 920 of file collections.py.

00920 
00921     def __eq__(self, string):
00922         if isinstance(string, UserString):
00923             return self.data == string.data
        return self.data == string

Here is the caller graph for this function:

Definition at line 916 of file collections.py.

00916 
    def __float__(self): return float(self.data)
def collections.UserString.__ge__ (   self,
  string 
)

Definition at line 940 of file collections.py.

00940 
00941     def __ge__(self, string):
00942         if isinstance(string, UserString):
00943             return self.data >= string.data
00944         return self.data >= string

def collections.UserString.__getitem__ (   self,
  index 
)

Reimplemented from _abcoll.Sequence.

Definition at line 951 of file collections.py.

00951 
    def __getitem__(self, index): return self.__class__(self.data[index])

Here is the caller graph for this function:

def collections.UserString.__gt__ (   self,
  string 
)

Definition at line 936 of file collections.py.

00936 
00937     def __gt__(self, string):
00938         if isinstance(string, UserString):
00939             return self.data > string.data
        return self.data > string

Definition at line 918 of file collections.py.

00918 
00919     def __hash__(self): return hash(self.data)

def abc.ABCMeta.__instancecheck__ (   cls,
  instance 
) [inherited]
Override for isinstance(instance, cls).

Definition at line 158 of file abc.py.

00158 
00159     def __instancecheck__(cls, instance):
00160         """Override for isinstance(instance, cls)."""
00161         # Inline the cache checking
00162         subclass = instance.__class__
00163         if subclass in cls._abc_cache:
00164             return True
00165         subtype = type(instance)
00166         if subtype is subclass:
00167             if (cls._abc_negative_cache_version ==
00168                 ABCMeta._abc_invalidation_counter and
00169                 subclass in cls._abc_negative_cache):
00170                 return False
00171             # Fall back to the subclass check.
00172             return cls.__subclasscheck__(subclass)
00173         return any(cls.__subclasscheck__(c) for c in {subclass, subtype})

Here is the call graph for this function:

def abc.ABCMeta.__instancecheck__ (   cls,
  instance 
) [inherited]
Override for isinstance(instance, cls).

Definition at line 158 of file abc.py.

00158 
00159     def __instancecheck__(cls, instance):
00160         """Override for isinstance(instance, cls)."""
00161         # Inline the cache checking
00162         subclass = instance.__class__
00163         if subclass in cls._abc_cache:
00164             return True
00165         subtype = type(instance)
00166         if subtype is subclass:
00167             if (cls._abc_negative_cache_version ==
00168                 ABCMeta._abc_invalidation_counter and
00169                 subclass in cls._abc_negative_cache):
00170                 return False
00171             # Fall back to the subclass check.
00172             return cls.__subclasscheck__(subclass)
00173         return any(cls.__subclasscheck__(c) for c in {subclass, subtype})

Here is the call graph for this function:

def abc.ABCMeta.__instancecheck__ (   cls,
  instance 
) [inherited]
Override for isinstance(instance, cls).

Definition at line 158 of file abc.py.

00158 
00159     def __instancecheck__(cls, instance):
00160         """Override for isinstance(instance, cls)."""
00161         # Inline the cache checking
00162         subclass = instance.__class__
00163         if subclass in cls._abc_cache:
00164             return True
00165         subtype = type(instance)
00166         if subtype is subclass:
00167             if (cls._abc_negative_cache_version ==
00168                 ABCMeta._abc_invalidation_counter and
00169                 subclass in cls._abc_negative_cache):
00170                 return False
00171             # Fall back to the subclass check.
00172             return cls.__subclasscheck__(subclass)
00173         return any(cls.__subclasscheck__(c) for c in {subclass, subtype})

Here is the call graph for this function:

Definition at line 915 of file collections.py.

00915 
    def __int__(self): return int(self.data)
def _abcoll.Sequence.__iter__ (   self) [inherited]

Reimplemented from _abcoll.Iterable.

Definition at line 539 of file _abcoll.py.

00539 
00540     def __iter__(self):
00541         i = 0
00542         try:
00543             while True:
00544                 v = self[i]
00545                 yield v
00546                 i += 1
00547         except IndexError:
00548             return

def collections.UserString.__le__ (   self,
  string 
)

Definition at line 932 of file collections.py.

00932 
00933     def __le__(self, string):
00934         if isinstance(string, UserString):
00935             return self.data <= string.data
        return self.data <= string

Reimplemented from _abcoll.Sized.

Definition at line 950 of file collections.py.

00950 
    def __len__(self): return len(self.data)
def collections.UserString.__lt__ (   self,
  string 
)

Definition at line 928 of file collections.py.

00928 
00929     def __lt__(self, string):
00930         if isinstance(string, UserString):
00931             return self.data < string.data
        return self.data < string
def collections.UserString.__mod__ (   self,
  args 
)

Definition at line 965 of file collections.py.

00965 
00966     def __mod__(self, args):
00967         return self.__class__(self.data % args)

def collections.UserString.__mul__ (   self,
  n 
)

Definition at line 962 of file collections.py.

00962 
00963     def __mul__(self, n):
        return self.__class__(self.data*n)
def collections.UserString.__ne__ (   self,
  string 
)

Definition at line 924 of file collections.py.

00924 
00925     def __ne__(self, string):
00926         if isinstance(string, UserString):
00927             return self.data != string.data
        return self.data != string
def abc.ABCMeta.__new__ (   mcls,
  name,
  bases,
  namespace 
) [inherited]

Definition at line 116 of file abc.py.

00116 
00117     def __new__(mcls, name, bases, namespace):
00118         cls = super().__new__(mcls, name, bases, namespace)
00119         # Compute set of abstract method names
00120         abstracts = {name
00121                      for name, value in namespace.items()
00122                      if getattr(value, "__isabstractmethod__", False)}
00123         for base in bases:
00124             for name in getattr(base, "__abstractmethods__", set()):
00125                 value = getattr(cls, name, None)
00126                 if getattr(value, "__isabstractmethod__", False):
00127                     abstracts.add(name)
00128         cls.__abstractmethods__ = frozenset(abstracts)
00129         # Set up inheritance registry
00130         cls._abc_registry = WeakSet()
00131         cls._abc_cache = WeakSet()
00132         cls._abc_negative_cache = WeakSet()
00133         cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter
00134         return cls

Here is the call graph for this function:

def abc.ABCMeta.__new__ (   mcls,
  name,
  bases,
  namespace 
) [inherited]

Definition at line 116 of file abc.py.

00116 
00117     def __new__(mcls, name, bases, namespace):
00118         cls = super().__new__(mcls, name, bases, namespace)
00119         # Compute set of abstract method names
00120         abstracts = {name
00121                      for name, value in namespace.items()
00122                      if getattr(value, "__isabstractmethod__", False)}
00123         for base in bases:
00124             for name in getattr(base, "__abstractmethods__", set()):
00125                 value = getattr(cls, name, None)
00126                 if getattr(value, "__isabstractmethod__", False):
00127                     abstracts.add(name)
00128         cls.__abstractmethods__ = frozenset(abstracts)
00129         # Set up inheritance registry
00130         cls._abc_registry = WeakSet()
00131         cls._abc_cache = WeakSet()
00132         cls._abc_negative_cache = WeakSet()
00133         cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter
00134         return cls

Here is the call graph for this function:

def abc.ABCMeta.__new__ (   mcls,
  name,
  bases,
  namespace 
) [inherited]

Definition at line 116 of file abc.py.

00116 
00117     def __new__(mcls, name, bases, namespace):
00118         cls = super().__new__(mcls, name, bases, namespace)
00119         # Compute set of abstract method names
00120         abstracts = {name
00121                      for name, value in namespace.items()
00122                      if getattr(value, "__isabstractmethod__", False)}
00123         for base in bases:
00124             for name in getattr(base, "__abstractmethods__", set()):
00125                 value = getattr(cls, name, None)
00126                 if getattr(value, "__isabstractmethod__", False):
00127                     abstracts.add(name)
00128         cls.__abstractmethods__ = frozenset(abstracts)
00129         # Set up inheritance registry
00130         cls._abc_registry = WeakSet()
00131         cls._abc_cache = WeakSet()
00132         cls._abc_negative_cache = WeakSet()
00133         cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter
00134         return cls

Here is the call graph for this function:

def collections.UserString.__radd__ (   self,
  other 
)

Definition at line 958 of file collections.py.

00958 
00959     def __radd__(self, other):
00960         if isinstance(other, str):
00961             return self.__class__(other + self.data)
        return self.__class__(str(other) + self.data)

Definition at line 914 of file collections.py.

00914 
    def __repr__(self): return repr(self.data)
def _abcoll.Sequence.__reversed__ (   self) [inherited]

Definition at line 555 of file _abcoll.py.

00555 
00556     def __reversed__(self):
00557         for i in reversed(range(len(self))):
00558             yield self[i]

Definition at line 913 of file collections.py.

00913 
    def __str__(self): return str(self.data)

Here is the caller graph for this function:

def abc.ABCMeta.__subclasscheck__ (   cls,
  subclass 
) [inherited]
Override for issubclass(subclass, cls).

Definition at line 174 of file abc.py.

00174 
00175     def __subclasscheck__(cls, subclass):
00176         """Override for issubclass(subclass, cls)."""
00177         # Check cache
00178         if subclass in cls._abc_cache:
00179             return True
00180         # Check negative cache; may have to invalidate
00181         if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter:
00182             # Invalidate the negative cache
00183             cls._abc_negative_cache = WeakSet()
00184             cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter
00185         elif subclass in cls._abc_negative_cache:
00186             return False
00187         # Check the subclass hook
00188         ok = cls.__subclasshook__(subclass)
00189         if ok is not NotImplemented:
00190             assert isinstance(ok, bool)
00191             if ok:
00192                 cls._abc_cache.add(subclass)
00193             else:
00194                 cls._abc_negative_cache.add(subclass)
00195             return ok
00196         # Check if it's a direct subclass
00197         if cls in getattr(subclass, '__mro__', ()):
00198             cls._abc_cache.add(subclass)
00199             return True
00200         # Check if it's a subclass of a registered class (recursive)
00201         for rcls in cls._abc_registry:
00202             if issubclass(subclass, rcls):
00203                 cls._abc_cache.add(subclass)
00204                 return True
00205         # Check if it's a subclass of a subclass (recursive)
00206         for scls in cls.__subclasses__():
00207             if issubclass(subclass, scls):
00208                 cls._abc_cache.add(subclass)
00209                 return True
00210         # No dice; update negative cache
00211         cls._abc_negative_cache.add(subclass)
00212         return False

Here is the call graph for this function:

def abc.ABCMeta.__subclasscheck__ (   cls,
  subclass 
) [inherited]
Override for issubclass(subclass, cls).

Definition at line 174 of file abc.py.

00174 
00175     def __subclasscheck__(cls, subclass):
00176         """Override for issubclass(subclass, cls)."""
00177         # Check cache
00178         if subclass in cls._abc_cache:
00179             return True
00180         # Check negative cache; may have to invalidate
00181         if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter:
00182             # Invalidate the negative cache
00183             cls._abc_negative_cache = WeakSet()
00184             cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter
00185         elif subclass in cls._abc_negative_cache:
00186             return False
00187         # Check the subclass hook
00188         ok = cls.__subclasshook__(subclass)
00189         if ok is not NotImplemented:
00190             assert isinstance(ok, bool)
00191             if ok:
00192                 cls._abc_cache.add(subclass)
00193             else:
00194                 cls._abc_negative_cache.add(subclass)
00195             return ok
00196         # Check if it's a direct subclass
00197         if cls in getattr(subclass, '__mro__', ()):
00198             cls._abc_cache.add(subclass)
00199             return True
00200         # Check if it's a subclass of a registered class (recursive)
00201         for rcls in cls._abc_registry:
00202             if issubclass(subclass, rcls):
00203                 cls._abc_cache.add(subclass)
00204                 return True
00205         # Check if it's a subclass of a subclass (recursive)
00206         for scls in cls.__subclasses__():
00207             if issubclass(subclass, scls):
00208                 cls._abc_cache.add(subclass)
00209                 return True
00210         # No dice; update negative cache
00211         cls._abc_negative_cache.add(subclass)
00212         return False

Here is the call graph for this function:

def abc.ABCMeta.__subclasscheck__ (   cls,
  subclass 
) [inherited]
Override for issubclass(subclass, cls).

Definition at line 174 of file abc.py.

00174 
00175     def __subclasscheck__(cls, subclass):
00176         """Override for issubclass(subclass, cls)."""
00177         # Check cache
00178         if subclass in cls._abc_cache:
00179             return True
00180         # Check negative cache; may have to invalidate
00181         if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter:
00182             # Invalidate the negative cache
00183             cls._abc_negative_cache = WeakSet()
00184             cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter
00185         elif subclass in cls._abc_negative_cache:
00186             return False
00187         # Check the subclass hook
00188         ok = cls.__subclasshook__(subclass)
00189         if ok is not NotImplemented:
00190             assert isinstance(ok, bool)
00191             if ok:
00192                 cls._abc_cache.add(subclass)
00193             else:
00194                 cls._abc_negative_cache.add(subclass)
00195             return ok
00196         # Check if it's a direct subclass
00197         if cls in getattr(subclass, '__mro__', ()):
00198             cls._abc_cache.add(subclass)
00199             return True
00200         # Check if it's a subclass of a registered class (recursive)
00201         for rcls in cls._abc_registry:
00202             if issubclass(subclass, rcls):
00203                 cls._abc_cache.add(subclass)
00204                 return True
00205         # Check if it's a subclass of a subclass (recursive)
00206         for scls in cls.__subclasses__():
00207             if issubclass(subclass, scls):
00208                 cls._abc_cache.add(subclass)
00209                 return True
00210         # No dice; update negative cache
00211         cls._abc_negative_cache.add(subclass)
00212         return False

Here is the call graph for this function:

def _abcoll.Iterable.__subclasshook__ (   cls,
  C 
) [inherited]

Reimplemented in _abcoll.Iterator.

Definition at line 74 of file _abcoll.py.

00074 
00075     def __subclasshook__(cls, C):
00076         if cls is Iterable:
00077             if any("__iter__" in B.__dict__ for B in C.__mro__):
00078                 return True
00079         return NotImplemented
00080 

Here is the call graph for this function:

def _abcoll.Sized.__subclasshook__ (   cls,
  C 
) [inherited]

Definition at line 119 of file _abcoll.py.

00119 
00120     def __subclasshook__(cls, C):
00121         if cls is Sized:
00122             if any("__len__" in B.__dict__ for B in C.__mro__):
00123                 return True
00124         return NotImplemented
00125 

Here is the call graph for this function:

def _abcoll.Container.__subclasshook__ (   cls,
  C 
) [inherited]

Definition at line 133 of file _abcoll.py.

00133 
00134     def __subclasshook__(cls, C):
00135         if cls is Container:
00136             if any("__contains__" in B.__dict__ for B in C.__mro__):
00137                 return True
00138         return NotImplemented
00139 

Here is the call graph for this function:

Definition at line 969 of file collections.py.

00969 
    def capitalize(self): return self.__class__(self.data.capitalize())
def collections.UserString.center (   self,
  width,
  args 
)

Definition at line 970 of file collections.py.

00970 
00971     def center(self, width, *args):
        return self.__class__(self.data.center(width, *args))

Here is the caller graph for this function:

def _abcoll.Sequence.count (   self,
  value 
) [inherited]

Reimplemented in collections.UserList.

Definition at line 565 of file _abcoll.py.

00565 
00566     def count(self, value):
00567         return sum(1 for v in self if v == value)
00568 
00569 Sequence.register(tuple)
00570 Sequence.register(str)
00571 Sequence.register(range)
00572 

Here is the call graph for this function:

def collections.UserString.count (   self,
  sub,
  start = 0,
  end = _sys.maxsize 
)

Definition at line 972 of file collections.py.

00972 
00973     def count(self, sub, start=0, end=_sys.maxsize):
00974         if isinstance(sub, UserString):
00975             sub = sub.data
        return self.data.count(sub, start, end)
def collections.UserString.encode (   self,
  encoding = None,
  errors = None 
)

Definition at line 976 of file collections.py.

00976 
00977     def encode(self, encoding=None, errors=None): # XXX improve this?
00978         if encoding:
00979             if errors:
00980                 return self.__class__(self.data.encode(encoding, errors))
00981             return self.__class__(self.data.encode(encoding))
        return self.__class__(self.data.encode())

Here is the caller graph for this function:

def collections.UserString.endswith (   self,
  suffix,
  start = 0,
  end = _sys.maxsize 
)

Definition at line 982 of file collections.py.

00982 
00983     def endswith(self, suffix, start=0, end=_sys.maxsize):
        return self.data.endswith(suffix, start, end)
def collections.UserString.expandtabs (   self,
  tabsize = 8 
)

Definition at line 984 of file collections.py.

00984 
00985     def expandtabs(self, tabsize=8):
        return self.__class__(self.data.expandtabs(tabsize))
def collections.UserString.find (   self,
  sub,
  start = 0,
  end = _sys.maxsize 
)

Definition at line 986 of file collections.py.

00986 
00987     def find(self, sub, start=0, end=_sys.maxsize):
00988         if isinstance(sub, UserString):
00989             sub = sub.data
        return self.data.find(sub, start, end)

Here is the caller graph for this function:

def collections.UserString.format (   self,
  args,
  kwds 
)

Definition at line 990 of file collections.py.

00990 
00991     def format(self, *args, **kwds):
        return self.data.format(*args, **kwds)

Here is the caller graph for this function:

def _abcoll.Sequence.index (   self,
  value 
) [inherited]

Definition at line 559 of file _abcoll.py.

00559 
00560     def index(self, value):
00561         for i, v in enumerate(self):
00562             if v == value:
00563                 return i
00564         raise ValueError

Here is the call graph for this function:

Here is the caller graph for this function:

def collections.UserString.index (   self,
  sub,
  start = 0,
  end = _sys.maxsize 
)

Definition at line 992 of file collections.py.

00992 
00993     def index(self, sub, start=0, end=_sys.maxsize):
        return self.data.index(sub, start, end)

Here is the caller graph for this function:

Definition at line 995 of file collections.py.

00995 
    def isalnum(self): return self.data.isalnum()

Definition at line 994 of file collections.py.

00994 
    def isalpha(self): return self.data.isalpha()

Definition at line 996 of file collections.py.

00996 
    def isdecimal(self): return self.data.isdecimal()

Definition at line 997 of file collections.py.

00997 
    def isdigit(self): return self.data.isdigit()

Definition at line 998 of file collections.py.

00998 
    def isidentifier(self): return self.data.isidentifier()

Definition at line 999 of file collections.py.

00999 
    def islower(self): return self.data.islower()

Definition at line 1000 of file collections.py.

01000 
    def isnumeric(self): return self.data.isnumeric()

Definition at line 1001 of file collections.py.

01001 
    def isspace(self): return self.data.isspace()

Definition at line 1002 of file collections.py.

01002 
    def istitle(self): return self.data.istitle()

Definition at line 1003 of file collections.py.

01003 
    def isupper(self): return self.data.isupper()
def collections.UserString.join (   self,
  seq 
)

Definition at line 1004 of file collections.py.

01004 
    def join(self, seq): return self.data.join(seq)

Here is the caller graph for this function:

def collections.UserString.ljust (   self,
  width,
  args 
)

Definition at line 1005 of file collections.py.

01005 
01006     def ljust(self, width, *args):
        return self.__class__(self.data.ljust(width, *args))

Definition at line 1007 of file collections.py.

01007 
    def lower(self): return self.__class__(self.data.lower())

Here is the caller graph for this function:

def collections.UserString.lstrip (   self,
  chars = None 
)

Definition at line 1008 of file collections.py.

01008 
    def lstrip(self, chars=None): return self.__class__(self.data.lstrip(chars))
def collections.UserString.partition (   self,
  sep 
)

Definition at line 1009 of file collections.py.

01009 
01010     def partition(self, sep):
        return self.data.partition(sep)
def abc.ABCMeta.register (   cls,
  subclass 
) [inherited]
Register a virtual subclass of an ABC.

Definition at line 135 of file abc.py.

00135 
00136     def register(cls, subclass):
00137         """Register a virtual subclass of an ABC."""
00138         if not isinstance(subclass, type):
00139             raise TypeError("Can only register classes")
00140         if issubclass(subclass, cls):
00141             return  # Already a subclass
00142         # Subtle: test for cycles *after* testing for "already a subclass";
00143         # this means we allow X.register(X) and interpret it as a no-op.
00144         if issubclass(cls, subclass):
00145             # This would create a cycle, which is bad for the algorithm below
00146             raise RuntimeError("Refusing to create an inheritance cycle")
00147         cls._abc_registry.add(subclass)
00148         ABCMeta._abc_invalidation_counter += 1  # Invalidate negative cache

Here is the caller graph for this function:

def abc.ABCMeta.register (   cls,
  subclass 
) [inherited]
Register a virtual subclass of an ABC.

Definition at line 135 of file abc.py.

00135 
00136     def register(cls, subclass):
00137         """Register a virtual subclass of an ABC."""
00138         if not isinstance(subclass, type):
00139             raise TypeError("Can only register classes")
00140         if issubclass(subclass, cls):
00141             return  # Already a subclass
00142         # Subtle: test for cycles *after* testing for "already a subclass";
00143         # this means we allow X.register(X) and interpret it as a no-op.
00144         if issubclass(cls, subclass):
00145             # This would create a cycle, which is bad for the algorithm below
00146             raise RuntimeError("Refusing to create an inheritance cycle")
00147         cls._abc_registry.add(subclass)
00148         ABCMeta._abc_invalidation_counter += 1  # Invalidate negative cache

Here is the caller graph for this function:

def abc.ABCMeta.register (   cls,
  subclass 
) [inherited]
Register a virtual subclass of an ABC.

Definition at line 135 of file abc.py.

00135 
00136     def register(cls, subclass):
00137         """Register a virtual subclass of an ABC."""
00138         if not isinstance(subclass, type):
00139             raise TypeError("Can only register classes")
00140         if issubclass(subclass, cls):
00141             return  # Already a subclass
00142         # Subtle: test for cycles *after* testing for "already a subclass";
00143         # this means we allow X.register(X) and interpret it as a no-op.
00144         if issubclass(cls, subclass):
00145             # This would create a cycle, which is bad for the algorithm below
00146             raise RuntimeError("Refusing to create an inheritance cycle")
00147         cls._abc_registry.add(subclass)
00148         ABCMeta._abc_invalidation_counter += 1  # Invalidate negative cache

Here is the caller graph for this function:

def collections.UserString.replace (   self,
  old,
  new,
  maxsplit = -1 
)

Definition at line 1011 of file collections.py.

01011 
01012     def replace(self, old, new, maxsplit=-1):
01013         if isinstance(old, UserString):
01014             old = old.data
01015         if isinstance(new, UserString):
01016             new = new.data
        return self.__class__(self.data.replace(old, new, maxsplit))
def collections.UserString.rfind (   self,
  sub,
  start = 0,
  end = _sys.maxsize 
)

Definition at line 1017 of file collections.py.

01017 
01018     def rfind(self, sub, start=0, end=_sys.maxsize):
01019         if isinstance(sub, UserString):
01020             sub = sub.data
        return self.data.rfind(sub, start, end)
def collections.UserString.rindex (   self,
  sub,
  start = 0,
  end = _sys.maxsize 
)

Definition at line 1021 of file collections.py.

01021 
01022     def rindex(self, sub, start=0, end=_sys.maxsize):
        return self.data.rindex(sub, start, end)
def collections.UserString.rjust (   self,
  width,
  args 
)

Definition at line 1023 of file collections.py.

01023 
01024     def rjust(self, width, *args):
        return self.__class__(self.data.rjust(width, *args))
def collections.UserString.rpartition (   self,
  sep 
)

Definition at line 1025 of file collections.py.

01025 
01026     def rpartition(self, sep):
        return self.data.rpartition(sep)
def collections.UserString.rsplit (   self,
  sep = None,
  maxsplit = -1 
)

Definition at line 1031 of file collections.py.

01031 
01032     def rsplit(self, sep=None, maxsplit=-1):
        return self.data.rsplit(sep, maxsplit)
def collections.UserString.rstrip (   self,
  chars = None 
)

Definition at line 1027 of file collections.py.

01027 
01028     def rstrip(self, chars=None):
        return self.__class__(self.data.rstrip(chars))
def collections.UserString.split (   self,
  sep = None,
  maxsplit = -1 
)

Definition at line 1029 of file collections.py.

01029 
01030     def split(self, sep=None, maxsplit=-1):
        return self.data.split(sep, maxsplit)
def collections.UserString.splitlines (   self,
  keepends = 0 
)

Definition at line 1033 of file collections.py.

01033 
    def splitlines(self, keepends=0): return self.data.splitlines(keepends)
def collections.UserString.startswith (   self,
  prefix,
  start = 0,
  end = _sys.maxsize 
)

Definition at line 1034 of file collections.py.

01034 
01035     def startswith(self, prefix, start=0, end=_sys.maxsize):
        return self.data.startswith(prefix, start, end)
def collections.UserString.strip (   self,
  chars = None 
)

Definition at line 1036 of file collections.py.

01036 
    def strip(self, chars=None): return self.__class__(self.data.strip(chars))

Definition at line 1037 of file collections.py.

01037 
    def swapcase(self): return self.__class__(self.data.swapcase())

Definition at line 1038 of file collections.py.

01038 
    def title(self): return self.__class__(self.data.title())
def collections.UserString.translate (   self,
  args 
)

Definition at line 1039 of file collections.py.

01039 
01040     def translate(self, *args):
        return self.__class__(self.data.translate(*args))

Definition at line 1041 of file collections.py.

01041 
    def upper(self): return self.__class__(self.data.upper())
def collections.UserString.zfill (   self,
  width 
)

Definition at line 1042 of file collections.py.

01042 
01043     def zfill(self, width): return self.__class__(self.data.zfill(width))
01044 
01045 


Member Data Documentation

Definition at line 964 of file collections.py.

Definition at line 908 of file collections.py.


The documentation for this class was generated from the following file: