Skip to content

Commit

Permalink
Remove mutable default arg value
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlatwe committed Feb 6, 2020
1 parent 3fdccb5 commit 839b1d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pyblish_qml/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Application(QtGui.QGuiApplication):
inFocused = QtCore.pyqtSignal()
outFocused = QtCore.pyqtSignal()

def __init__(self, source, targets=[]):
def __init__(self, source, targets=None):
super(Application, self).__init__(sys.argv)

self.setWindowIcon(QtGui.QIcon(ICON_PATH))
Expand Down Expand Up @@ -281,7 +281,7 @@ def _listen():
thread.start()


def main(demo=False, aschild=False, targets=[]):
def main(demo=False, aschild=False, targets=None):
"""Start the Qt-runtime and show the window
Arguments:
Expand Down
7 changes: 4 additions & 3 deletions pyblish_qml/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ class Controller(QtCore.QObject):
resultModel = qtproperty(lambda self: self.data["models"]["result"])
resultProxy = qtproperty(lambda self: self.data["proxies"]["result"])

def __init__(self, host, parent=None, targets=[]):
def __init__(self, host, parent=None, targets=None):
super(Controller, self).__init__(parent)

# Connection to host
self.host = host

self.targets = targets
self.targets = targets or []

self.data = {
"models": {
Expand Down Expand Up @@ -984,7 +984,7 @@ def on_finished():

util.defer(get_data, callback=on_data_received)

def run(self, plugins, context, callback=None, callback_args=[]):
def run(self, plugins, context, callback=None, callback_args=None):
"""Commence asynchronous tasks
This method runs through the provided `plugins` in
Expand All @@ -1001,6 +1001,7 @@ def run(self, plugins, context, callback=None, callback_args=[]):
callback_args (list, optional): Arguments passed to callback
"""
callback_args = callback_args or []

# if "ready" not in self.states:
# return self.error.emit("Not ready")
Expand Down

0 comments on commit 839b1d9

Please sign in to comment.