Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)
Python 2 version
"%(u)s'abc'" --> "u'abc'"
"%(b)s'abc'" --> "'abc'"
"55%(L)s"    --> "55L"

Accepts a string or a function, so it can be used as a decorator.

            @wraps(str_change_func)
    def wrapper(func_or_str):
        if isinstance(func_or_str, str):
            func = None
            doc = func_or_str
        else:
            func = func_or_str
            doc = func.__doc__
        
        doc = str_change_func(doc)
        
        if func:
            func.__doc__ = doc
            return func
        return doc