def __getattr__(self, name):
        '''We attemt to provide access to all methods that are available on a
        regular str object, whilst wrapping up answers appropriately.
        '''
        try:
            return types.MethodType(self._method_cache[name], self)
        except KeyError:
            str_cls_method = getattr(str, name)
            @wraps(str_cls_method)
            def str_method_executor(self, *args, **kwargs):
                reference = str_cls_method(str(self), *args, **kwargs)
                if isinstance(reference, list):
                    return self._apply_list_returning_str_method(
                        name, *args, reference=reference, **kwargs)
                elif isinstance(reference, str):
                    raise NotImplementedError(
                        "str method {!r} has not yet been implemented for a "
                        "{}, sorry :-(".format(name, self.__class__.__name__))
                else:
                    return reference
            self._method_cache[name] = str_method_executor
            return types.MethodType(str_method_executor, self)
def __getattr__ ( self , name ) : try : return types . MethodType ( self . _method_cache [ name ] , self ) except KeyError : str_cls_method = getattr ( str , name ) @ wraps ( str_cls_method ) def str_method_executor ( self , * args , ** kwargs ) : reference = str_cls_method ( str ( self ) , * args , ** kwargs ) if isinstance ( reference , list ) : return self . _apply_list_returning_str_method ( name , * args , reference = reference , ** kwargs ) elif isinstance ( reference , str ) : raise NotImplementedError ( "str method {!r} has not yet been implemented for a " "{}, sorry :-(" . format ( name , self . __class__ . __name__ ) ) else : return reference self . _method_cache [ name ] = str_method_executor return types . MethodType ( str_method_executor , self )
We attemt to provide access to all methods that are available on a
        regular str object, whilst wrapping up answers appropriately.