@@ -127,13 +127,13 @@ def signals(
127127 :param expressions_: If True, the values of the signals will be evaluated as expressions
128128 rather than literals.
129129 """
130- signals = {** (signals_dict if signals_dict else {}), ** signals }
130+ signals = {** (signals_dict or {}), ** signals }
131131 val = _js_object (signals ) if expressions_ else json .dumps (signals )
132132 return SignalsAttr (value = val , alias = self ._alias )
133133
134134 def computed (self , computed_dict : Mapping | None = None , / , ** computed : str ) -> BaseAttr :
135135 """Create signals that are computed based on an expression."""
136- computed = {** (computed_dict if computed_dict else {}), ** computed }
136+ computed = {** (computed_dict or {}), ** computed }
137137 first , * rest = (
138138 BaseAttr ("computed" , key = sig , value = expr , alias = self ._alias )
139139 for sig , expr in computed .items ()
@@ -152,7 +152,7 @@ def ignore(self) -> IgnoreAttr:
152152
153153 def attr (self , attr_dict : Mapping | None = None , / , ** attrs : str ) -> BaseAttr :
154154 """Set the value of any HTML attributes to expressions, and keep them in sync."""
155- attrs = {** (attr_dict if attr_dict else {}), ** attrs }
155+ attrs = {** (attr_dict or {}), ** attrs }
156156 return BaseAttr ("attr" , value = _js_object (attrs ), alias = self ._alias )
157157
158158 def bind (self , signal_name : str ) -> BaseAttr :
@@ -161,7 +161,7 @@ def bind(self, signal_name: str) -> BaseAttr:
161161
162162 def class_ (self , class_dict : Mapping | None = None , / , ** classes : str ) -> BaseAttr :
163163 """Add or removes classes to or from an element based on expressions."""
164- classes = {** (class_dict if class_dict else {}), ** classes }
164+ classes = {** (class_dict or {}), ** classes }
165165 return BaseAttr ("class" , value = _js_object (classes ), alias = self ._alias )
166166
167167 def init (self , expression : str ) -> InitAttr :
@@ -216,7 +216,7 @@ def show(self, expression: str) -> BaseAttr:
216216
217217 def style (self , style_dict : Mapping | None = None , / , ** styles : str ) -> BaseAttr :
218218 """Set the value of inline CSS styles on an element based on an expression, and keeps them in sync."""
219- styles = {** (style_dict if style_dict else {}), ** styles }
219+ styles = {** (style_dict or {}), ** styles }
220220 return BaseAttr ("style" , value = _js_object (styles ), alias = self ._alias )
221221
222222 def text (self , expression : str ) -> BaseAttr :
@@ -654,7 +654,7 @@ def threshold(self, threshold: int) -> Self:
654654class OnIntervalAttr (BaseAttr , ViewtransitionMod ):
655655 _attr = "on-interval"
656656
657- def duration (self , duration : int | float | str , * , leading : bool = False ) -> Self :
657+ def duration (self , duration : float | str , * , leading : bool = False ) -> Self :
658658 """Set the interval duration."""
659659 self ._mods ["duration" ] = [str (duration )]
660660 if leading :
0 commit comments