Bläddra i källkod

PR #500, point 4: Remove default arguments for rows and columns parameter, making them mandatory

Dominique CLAUSE 2 år sedan
förälder
incheckning
a19cf91775
1 ändrade filer med 2 tillägg och 7 borttagningar
  1. 2 7
      nicegui/elements/table.py

+ 2 - 7
nicegui/elements/table.py

@@ -33,8 +33,8 @@ class QTable(ValueElement):
 
     def __init__(
             self,
-            columns: Optional[list] = None,
-            rows: Optional[list] = None,
+            columns: list,
+            rows: list,
             title: Optional[str] = None,
             selection: Optional[Literal['single', 'multiple', 'none']] = 'none',
             on_filter_change: Optional[Callable] = None,
@@ -54,11 +54,6 @@ class QTable(ValueElement):
 
         super().__init__(tag='q-table', value='', on_value_change=on_filter_change)
 
-        if columns is None:
-            columns = []
-        if rows is None:
-            rows = []
-
         self._props['columns'] = columns
         self._props['rows'] = rows
         self._props['title'] = title