projects
/
vuplus_dvbapp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b7d760
)
add kwargs support to boundFunction
author
Felix Domke
<tmbinc@elitedvb.net>
Sun, 19 Feb 2006 23:36:17 +0000
(23:36 +0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Sun, 19 Feb 2006 23:36:17 +0000
(23:36 +0000)
lib/python/Tools/BoundFunction.py
patch
|
blob
|
history
diff --git
a/lib/python/Tools/BoundFunction.py
b/lib/python/Tools/BoundFunction.py
index
5447451
..
f28a50c
100644
(file)
--- a/
lib/python/Tools/BoundFunction.py
+++ b/
lib/python/Tools/BoundFunction.py
@@
-1,6
+1,9
@@
class boundFunction:
- def __init__(self, fnc, *args):
+ def __init__(self, fnc, *args
, **kwargs
):
self.fnc = fnc
self.args = args
- def __call__(self, *args):
- self.fnc(*self.args + args)
+ self.kwargs = kwargs
+ def __call__(self, *args, **kwargs):
+ newkwargs = self.kwargs
+ newkwargs.update(kwargs)
+ self.fnc(*self.args + args, **newkwargs)