MCPcopy Create free account
hub / github.com/ActiveState/code / register

Method register

recipes/Python/578450_Factory_pattern/recipe-578450.py:50–54  ·  view source on GitHub ↗

register a constructor

(self, methodName, constructor, *args, **kargs)

Source from the content-addressed store, hash-verified

48
49class Factory:
50 def register(self, methodName, constructor, *args, **kargs):
51 """register a constructor"""
52 _args = [constructor]
53 _args.extend(args)
54 setattr(self, methodName,apply(Functor,_args, kargs))
55
56 def unregister(self, methodName):
57 """unregister a constructor"""

Callers 8

recipe-546539.pyFile · 0.45
register_funFunction · 0.45
recipe-533117.pyFile · 0.45
_prepare_tkdnd_funcMethod · 0.45
recipe-523007.pyFile · 0.45
autocompleteFunction · 0.45
recipe-573436.pyFile · 0.45
_sendfile_use_sendfileFunction · 0.45

Calls 2

applyFunction · 0.50
extendMethod · 0.45

Tested by

no test coverage detected