From 84e8c03c446bb5107d00ccc2a36df0b4dbe525a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ignacio=20Romero?= Date: Mon, 27 Dec 2021 15:04:03 -0600 Subject: [PATCH] Dont put mutables where they are initialized only once --- src/Mod/Path/PathScripts/PathDressupLeadInOut.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDressupLeadInOut.py b/src/Mod/Path/PathScripts/PathDressupLeadInOut.py index 021cfd93f9..a48f7be4ad 100644 --- a/src/Mod/Path/PathScripts/PathDressupLeadInOut.py +++ b/src/Mod/Path/PathScripts/PathDressupLeadInOut.py @@ -596,7 +596,7 @@ PROP_TYPE_NUMERIC = PROP_TYPE_QTYES + ["App::PropertyPercent", "App:PropertyFloa class SimpleEditPanel: - _fc = {} + _fc = None obj = None form = None @@ -608,7 +608,11 @@ class SimpleEditPanel: for prop_name, (get_field, set_field) in self._fc.items(): set_field(getattr(self.obj, prop_name)) - def connectWidget(self, prop_name, widget, custom_lbls={}): + def connectWidget(self, prop_name, widget, custom_lbls=None): + if custom_lbls is None: + custom_lbls = {} + if self._fc is None: + self._fc = {} prop_type = self.obj.getTypeIdOfProperty(prop_name) widget_type = type(widget).__name__ if prop_type == "App::PropertyEnumeration" and widget_type == "QComboBox":