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

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)

                    @wraps(target)
            def inner(*args, **kw):
                if check_version and removed_in_version:
                    raise_if_deprecated(target, removed_in_version)
                warnings.warn(msg.format(funcname=funcname,
                                         replacement=repl_name,
                                         in_version=in_version),
                              stacklevel=2)
                return target(*args, **kw)
        


src/x/o/xoutil-1.5.4/tests/test_basic_aop.py   xoutil(Download)
 
from datetime import timedelta
from xoutil.aop import weaved
from xoutil.aop.basic import contextualized, complementor
from xoutil.six.moves import range
        sobj = self.SimpleObject()
        prev = sobj.ident(99)
        with weaved(sobj, ident=plusone) as sobj:
            _class = sobj.__class__
            self.assertEqual(prev + 1, sobj.ident(99))
        sobj = self.SimpleObject()
        prev = sobj.ident(99)
        with weaved(sobj, ident=plusone) as sobj:
            _class = sobj.__class__
            with weaved(sobj, ident=plustwo) as sobj: