File: test_method_hook.py

package info (click to toggle)
python-extclass 1.2-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 432 kB
  • ctags: 547
  • sloc: ansic: 4,549; python: 134; makefile: 46; sh: 18
file content (15 lines) | stat: -rw-r--r-- 261 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

import ExtensionClass

class C(ExtensionClass.Base):

    def __call_method__(self,meth,args,kw={}):
	print 'give us a hook, hook, hook...'
	apply(meth,args,kw)

    def hi(self,*args,**kw): print self, args, kw

c=C()
c.hi()
c.hi(1,2,3)
c.hi(1,2,spam='eggs')