Browse Source

code review

Falko Schindler 1 year ago
parent
commit
8f0fa292c8
2 changed files with 5 additions and 7 deletions
  1. 1 3
      nicegui/observables.py
  2. 4 4
      website/documentation.py

+ 1 - 3
nicegui/observables.py

@@ -115,9 +115,7 @@ class ObservableSet(set):
                  data: set = None,  # type: ignore
                  on_change: Optional[Callable] = None,
                  ) -> None:
-        if data is None:
-            data = set()
-        super().__init__(data)
+        super().__init__(set() if data is None else data)
         for item in self:
             super().add(make_observable(item, on_change))
         self._change_handlers: List[Callable] = []

+ 4 - 4
website/documentation.py

@@ -531,11 +531,11 @@ def create_full() -> None:
         ui.button('shutdown', on_click=lambda: ui.notify(
             'Nah. We do not actually shutdown the documentation server. Try it in your own app!'))
 
-    @text_demo('Urls', '''
-        You can access the list of all urls on which the NiceGUI app is available via `app.urls`.
-        The urls are not available in `app.on_startup` because the server is not yet running.
+    @text_demo('URLs', '''
+        You can access the list of all URLs on which the NiceGUI app is available via `app.urls`.
+        The URLs are not available in `app.on_startup` because the server is not yet running.
         Instead, you can access them in a page function or register a callback with `app.urls.on_change`.
-        ''')
+    ''')
     def urls_demo():
         from nicegui import app