示例#1
0
文件: tests.py 项目: bhfwg/py_learn
def test0():
    line()
    from overridee import aclass
    aclass.show(1, 2, 3)
    from overrider import aclass
    aclass.show(1, 2, 3)
    from overrider import _aclass_show
    _aclass_show(1, 2, 3)
    from overrider import aclass_show
    aclass_show(1, 2, 3)
示例#2
0
def test0():
    line()
    from overridee import aclass
    aclass.show(1, 2, 3)
    from overrider import aclass
    aclass.show(1, 2, 3)
    from overrider import _aclass_show
    _aclass_show(1, 2, 3)
    from overrider import aclass_show
    aclass_show(1, 2, 3)
示例#3
0
文件: tests.py 项目: bhfwg/py_learn
def test1():
    line()
    from overrider import aclass
    aclass.show(1, 2, 3)
    reload(overridee)  # has no effects
    print 'overridee reloaded'
    aclass.show(1, 2, 3)
    from overridee import aclass
    aclass.show(1, 2, 3)
示例#4
0
def test1():
    line()
    from overrider import aclass
    aclass.show(1, 2, 3)
    reload(overridee)  # has no effects
    print 'overridee reloaded'
    aclass.show(1, 2, 3)
    from overridee import aclass
    aclass.show(1, 2, 3)
示例#5
0
文件: tests.py 项目: bhfwg/py_learn
def test2():
    line()
    from overridee import aclass
    aclass.show(1, 2, 3)
    from overrider import before
    print before
    aclass.show(1, 2, 3)
    from overrider import after  # has no effects
    print after
    aclass.show(1, 2, 3)
示例#6
0
def test2():
    line()
    from overridee import aclass
    aclass.show(1, 2, 3)
    from overrider import before
    print before
    aclass.show(1, 2, 3)
    from overrider import after  # has no effects
    print after
    aclass.show(1, 2, 3)
示例#7
0
#!/usr/bin/env python
# encoding: utf-8

from overridee import aclass

before = 'before'
_aclass_show = aclass.show


def aclass_show(a, b=0, c=None):
    if b > 0:
        print a, b
    else:
        _aclass_show(a, b, c)


aclass.show = aclass_show
after = 'after'

if __name__ == '__main__':
    _aclass_show(1, -2)
    aclass.show(1, -2)
    _aclass_show(1, -2, 3)
    aclass.show(1, -2, 3)
    _aclass_show(1, 2)
    aclass.show(1, 2)
    _aclass_show(1, 2, 3)
    aclass.show(1, 2, 3)
示例#8
0
#!/usr/bin/env python
# encoding: utf-8

from overridee import aclass

before = 'before'
_aclass_show = aclass.show


def aclass_show(a, b=0, c=None):
    if b > 0:
        print a, b
    else:
        _aclass_show(a, b, c)
aclass.show = aclass_show
after = 'after'

if __name__ == '__main__':
    _aclass_show(1, -2)
    aclass.show(1, -2)
    _aclass_show(1, -2, 3)
    aclass.show(1, -2, 3)
    _aclass_show(1, 2)
    aclass.show(1, 2)
    _aclass_show(1, 2, 3)
    aclass.show(1, 2, 3)
示例#9
0
from overridee import aclass

_aclass_show = aclass.show
def aclass_show(a, b=0, c=None):
    if b>0:
        print a, b
    else:
        _aclass_show(a, b)
aclass.show = aclass_show


something = 'something'

if __name__ == '__main__':
    _aclass_show(1)
    _aclass_show(1, 2)
    _aclass_show(1, 2, 3)
    aclass.show(1)
    aclass.show(1, 2)
    aclass.show(1, 2, 3)