Skip to content

Commit 28e8162

Browse files
authored
Merge pull request #3249 from peter-gerlagh-kyos/fix/help-mypy-with-layout-setter
Move the dash.layout.setter so that type checkers can find it easier
2 parents ecc2e03 + 15516d6 commit 28e8162

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

dash/dash.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -746,15 +746,6 @@ def _setup_plotlyjs(self):
746746
def layout(self):
747747
return self._layout
748748

749-
def _layout_value(self):
750-
layout = self._layout() if self._layout_is_function else self._layout
751-
752-
# Add any extra components
753-
if self._extra_components:
754-
layout = html.Div(children=[layout] + self._extra_components)
755-
756-
return layout
757-
758749
@layout.setter
759750
def layout(self, value):
760751
_validate.validate_layout_type(value)
@@ -773,6 +764,15 @@ def layout(self, value):
773764
_validate.validate_layout(value, layout_value)
774765
self.validation_layout = layout_value
775766

767+
def _layout_value(self):
768+
layout = self._layout() if self._layout_is_function else self._layout
769+
770+
# Add any extra components
771+
if self._extra_components:
772+
layout = html.Div(children=[layout] + self._extra_components)
773+
774+
return layout
775+
776776
@property
777777
def index_string(self):
778778
return self._index_string

0 commit comments

Comments
 (0)