File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1414 Annotated ,
1515 Any ,
1616 Generic ,
17+ NoReturn ,
1718 Protocol ,
1819 TypedDict ,
1920 TypeVar ,
@@ -1683,6 +1684,16 @@ def get_fn_signature(fn: Callable) -> inspect.Signature:
16831684class EventVar (ObjectVar , python_types = (EventSpec , EventHandler )):
16841685 """Base class for event vars."""
16851686
1687+ def bool (self ) -> NoReturn :
1688+ """Get the boolean value of the var.
1689+
1690+ Raises:
1691+ TypeError: EventVar cannot be converted to a boolean.
1692+ """
1693+ raise TypeError (
1694+ f"Cannot convert { self ._js_expr } of type { type (self ).__name__ } to bool."
1695+ )
1696+
16861697
16871698@dataclasses .dataclass (
16881699 eq = False ,
@@ -1759,6 +1770,16 @@ def no_args():
17591770class EventChainVar (BuilderFunctionVar , python_types = EventChain ):
17601771 """Base class for event chain vars."""
17611772
1773+ def bool (self ) -> NoReturn :
1774+ """Get the boolean value of the var.
1775+
1776+ Raises:
1777+ TypeError: EventChainVar cannot be converted to a boolean.
1778+ """
1779+ raise TypeError (
1780+ f"Cannot convert { self ._js_expr } of type { type (self ).__name__ } to bool."
1781+ )
1782+
17621783
17631784@dataclasses .dataclass (
17641785 eq = False ,
You can’t perform that action at this time.
0 commit comments