]> 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 lists in function definitions
authorTomas Babej <tomasbabej@gmail.com>
Thu, 6 Aug 2015 21:20:51 +0000 (23:20 +0200)
committerTomas Babej <tomasbabej@gmail.com>
Thu, 6 Aug 2015 21:20:51 +0000 (23:20 +0200)
tasklib/task.py

index ed89653eab7e593a396bcaa6720cc2266e859599..35fc2b710c7d99fde6cd2397a02fbe442aa2a0ec 100644 (file)
@@ -744,7 +744,7 @@ class Task(TaskResource):
 
         return args
 
-    def refresh(self, only_fields=[], after_save=False):
+    def refresh(self, only_fields=None, after_save=False):
         # Raise error when trying to refresh a task that has not been saved
         if not self.saved:
             raise Task.NotSaved("Task needs to be saved to be refreshed")
@@ -798,8 +798,8 @@ class TaskFilter(SerializingObject):
     A set of parameters to filter the task list with.
     """
 
-    def __init__(self, warrior, filter_params=[]):
-        self.filter_params = filter_params
+    def __init__(self, warrior, filter_params=None):
+        self.filter_params = filter_params or []
         super(TaskFilter, self).__init__(warrior)
 
     def add_filter(self, filter_str):