dang it darglint

This commit is contained in:
Khaleel Al-Adhami 2025-01-29 16:38:10 -08:00
parent f94a08c568
commit 4dc3d44cea
2 changed files with 12 additions and 4 deletions

View File

@ -1199,15 +1199,14 @@ class Var(Generic[VAR_TYPE]):
Args: Args:
name: The name of the attribute. name: The name of the attribute.
Returns:
The attribute.
Raises: Raises:
VarAttributeError: If the attribute does not exist. VarAttributeError: If the attribute does not exist.
TypeError: If the var type is Any. TypeError: If the var type is Any.
# noqa: DAR101 self
""" """
if name.startswith("_"): if name.startswith("_"):
raise AttributeError(f"Attribute {name} not found.") raise VarAttributeError(f"Attribute {name} not found.")
if name == "contains": if name == "contains":
raise TypeError( raise TypeError(
@ -1230,6 +1229,8 @@ class Var(Generic[VAR_TYPE]):
Raises: Raises:
VarTypeError: when attempting to bool-ify the Var. VarTypeError: when attempting to bool-ify the Var.
# noqa: DAR101 self
""" """
raise VarTypeError( raise VarTypeError(
f"Cannot convert Var {str(self)!r} to bool for use with `if`, `and`, `or`, and `not`. " f"Cannot convert Var {str(self)!r} to bool for use with `if`, `and`, `or`, and `not`. "
@ -1241,6 +1242,8 @@ class Var(Generic[VAR_TYPE]):
Raises: Raises:
VarTypeError: when attempting to iterate over the Var. VarTypeError: when attempting to iterate over the Var.
# noqa: DAR101 self
""" """
raise VarTypeError( raise VarTypeError(
f"Cannot iterate over Var {str(self)!r}. Instead use `rx.foreach`." f"Cannot iterate over Var {str(self)!r}. Instead use `rx.foreach`."
@ -1251,6 +1254,8 @@ class Var(Generic[VAR_TYPE]):
Raises: Raises:
VarTypeError: the operation is not supported VarTypeError: the operation is not supported
# noqa: DAR101 self
""" """
raise VarTypeError( raise VarTypeError(
"'in' operator not supported for Var types, use Var.contains() instead." "'in' operator not supported for Var types, use Var.contains() instead."

View File

@ -1289,6 +1289,9 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]):
Returns: Returns:
The JSON representation of the var. The JSON representation of the var.
Raises:
TypeError: If the array elements are not of type LiteralVar.
""" """
elements = [] elements = []
for element in self._var_value: for element in self._var_value: