]> git.madduck.net Git - etc/taskwarrior.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Do not use mutable dicts in function headers
authorTomas Babej <tomasbabej@gmail.com>
Sat, 8 Aug 2015 12:41:43 +0000 (14:41 +0200)
committerTomas Babej <tomasbabej@gmail.com>
Sat, 8 Aug 2015 12:46:48 +0000 (14:46 +0200)
tasklib/task.py

index 0a3b74aeab0b43919185065596fbb17c9e354d10..8374eb79998980b2af4a997db17cc026ac4bb229 100644 (file)
@@ -394,9 +394,9 @@ class TaskResource(SerializingObject):
 class TaskAnnotation(TaskResource):
     read_only_fields = ['entry', 'description']
 
 class TaskAnnotation(TaskResource):
     read_only_fields = ['entry', 'description']
 
-    def __init__(self, task, data={}):
+    def __init__(self, task, data=None):
         self.task = task
         self.task = task
-        self._load_data(data)
+        self._load_data(data or dict())
         super(TaskAnnotation, self).__init__(task.warrior)
 
     def remove(self):
         super(TaskAnnotation, self).__init__(task.warrior)
 
     def remove(self):
@@ -986,10 +986,10 @@ class TaskWarrior(object):
 
         self.tasks = TaskQuerySet(self)
 
 
         self.tasks = TaskQuerySet(self)
 
-    def _get_command_args(self, args, config_override={}):
+    def _get_command_args(self, args, config_override=None):
         command_args = ['task', 'rc:{0}'.format(self.taskrc_location)]
         config = self.config.copy()
         command_args = ['task', 'rc:{0}'.format(self.taskrc_location)]
         config = self.config.copy()
-        config.update(config_override)
+        config.update(config_override or dict())
         for item in config.items():
             command_args.append('rc.{0}={1}'.format(*item))
         command_args.extend(map(six.text_type, args))
         for item in config.items():
             command_args.append('rc.{0}={1}'.format(*item))
         command_args.extend(map(six.text_type, args))
@@ -1019,7 +1019,7 @@ class TaskWarrior(object):
 
         return config
 
 
         return config
 
-    def execute_command(self, args, config_override={}, allow_failure=True,
+    def execute_command(self, args, config_override=None, allow_failure=True,
                         return_all=False):
         command_args = self._get_command_args(
             args, config_override=config_override)
                         return_all=False):
         command_args = self._get_command_args(
             args, config_override=config_override)