diff options
author | André Erdmann <dywi@mailerd.de> | 2013-08-23 15:37:22 +0200 |
---|---|---|
committer | André Erdmann <dywi@mailerd.de> | 2013-08-23 15:37:22 +0200 |
commit | d0954117899d73fcca82f66a933974d9c39966fd (patch) | |
tree | 3d299e19cf399bc08afc7d624613b73f54412494 /roverlay/util/namespace.py | |
parent | doc/html, package rules: 'add' action (diff) | |
download | R_overlay-d0954117899d73fcca82f66a933974d9c39966fd.tar.gz R_overlay-d0954117899d73fcca82f66a933974d9c39966fd.tar.bz2 R_overlay-d0954117899d73fcca82f66a933974d9c39966fd.zip |
roverlay/util/namespace: add default values
for args, kwargs to get_object_v()
Diffstat (limited to 'roverlay/util/namespace.py')
-rw-r--r-- | roverlay/util/namespace.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/roverlay/util/namespace.py b/roverlay/util/namespace.py index 86d102f..5dce92e 100644 --- a/roverlay/util/namespace.py +++ b/roverlay/util/namespace.py @@ -52,7 +52,7 @@ class AbstractNamespace ( object ): # --- end of get_dict_hash (...) --- @roverlay.util.objects.abstractmethod - def get_object_v ( self, cls, args, kwargs ): + def get_object_v ( self, cls, args=(), kwargs={} ): """Returns the desired object. The object will be created if it does not already exist in the @@ -83,7 +83,7 @@ class NullNamespace ( AbstractNamespace ): pass # --- end of zap (...) --- - def get_object_v ( self, cls, args, kwargs ): + def get_object_v ( self, cls, args=(), kwargs={} ): return cls ( *args, **kwargs ) # --- end of get_object_v (...) --- @@ -111,7 +111,7 @@ class SimpleNamespace ( AbstractNamespace ): self._objects = dict() # --- end of __init__ (...) --- - def get_object_v ( self, cls, args, kwargs ): + def get_object_v ( self, cls, args=(), kwargs={} ): ident = ( hash ( args ) if args else 0, self.get_dict_hash ( kwargs ) if kwargs else 0, |