|
@@ -14,7 +14,6 @@ from typing import (
|
|
List,
|
|
List,
|
|
Literal,
|
|
Literal,
|
|
Mapping,
|
|
Mapping,
|
|
- NoReturn,
|
|
|
|
Sequence,
|
|
Sequence,
|
|
Type,
|
|
Type,
|
|
TypeVar,
|
|
TypeVar,
|
|
@@ -76,13 +75,7 @@ VALUE_TYPE = TypeVar("VALUE_TYPE")
|
|
class ArrayVar(Var[ARRAY_VAR_TYPE], python_types=(Sequence, set)):
|
|
class ArrayVar(Var[ARRAY_VAR_TYPE], python_types=(Sequence, set)):
|
|
"""Base class for immutable array vars."""
|
|
"""Base class for immutable array vars."""
|
|
|
|
|
|
- @overload
|
|
|
|
- def join(self, sep: StringVar | str = "") -> StringVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def join(self, sep: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def join(self, sep: Any = "") -> StringVar:
|
|
|
|
|
|
+ def join(self, sep: StringVar | str = "") -> StringVar:
|
|
"""Join the elements of the array.
|
|
"""Join the elements of the array.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -123,13 +116,7 @@ class ArrayVar(Var[ARRAY_VAR_TYPE], python_types=(Sequence, set)):
|
|
"""
|
|
"""
|
|
return array_reverse_operation(self)
|
|
return array_reverse_operation(self)
|
|
|
|
|
|
- @overload
|
|
|
|
- def __add__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> ArrayVar[ARRAY_VAR_TYPE]: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __add__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __add__(self, other: Any) -> ArrayVar[ARRAY_VAR_TYPE]:
|
|
|
|
|
|
+ def __add__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> ArrayVar[ARRAY_VAR_TYPE]:
|
|
"""Concatenate two arrays.
|
|
"""Concatenate two arrays.
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
@@ -352,13 +339,7 @@ class ArrayVar(Var[ARRAY_VAR_TYPE], python_types=(Sequence, set)):
|
|
"""
|
|
"""
|
|
return array_pluck_operation(self, field)
|
|
return array_pluck_operation(self, field)
|
|
|
|
|
|
- @overload
|
|
|
|
- def __mul__(self, other: NumberVar | int) -> ArrayVar[ARRAY_VAR_TYPE]: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __mul__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __mul__(self, other: Any) -> ArrayVar[ARRAY_VAR_TYPE]:
|
|
|
|
|
|
+ def __mul__(self, other: NumberVar | int) -> ArrayVar[ARRAY_VAR_TYPE]:
|
|
"""Multiply the sequence by a number or integer.
|
|
"""Multiply the sequence by a number or integer.
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
@@ -603,13 +584,7 @@ STRING_TYPE = TypingExtensionsTypeVar("STRING_TYPE", default=str)
|
|
class StringVar(Var[STRING_TYPE], python_types=str):
|
|
class StringVar(Var[STRING_TYPE], python_types=str):
|
|
"""Base class for immutable string vars."""
|
|
"""Base class for immutable string vars."""
|
|
|
|
|
|
- @overload
|
|
|
|
- def __add__(self, other: StringVar | str) -> ConcatVarOperation: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __add__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __add__(self, other: Any) -> ConcatVarOperation:
|
|
|
|
|
|
+ def __add__(self, other: StringVar | str) -> ConcatVarOperation:
|
|
"""Concatenate two strings.
|
|
"""Concatenate two strings.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -623,13 +598,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
|
|
|
|
return ConcatVarOperation.create(self, other)
|
|
return ConcatVarOperation.create(self, other)
|
|
|
|
|
|
- @overload
|
|
|
|
- def __radd__(self, other: StringVar | str) -> ConcatVarOperation: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __radd__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __radd__(self, other: Any) -> ConcatVarOperation:
|
|
|
|
|
|
+ def __radd__(self, other: StringVar | str) -> ConcatVarOperation:
|
|
"""Concatenate two strings.
|
|
"""Concatenate two strings.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -643,13 +612,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
|
|
|
|
return ConcatVarOperation.create(other, self)
|
|
return ConcatVarOperation.create(other, self)
|
|
|
|
|
|
- @overload
|
|
|
|
- def __mul__(self, other: NumberVar | int) -> StringVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __mul__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __mul__(self, other: Any) -> StringVar:
|
|
|
|
|
|
+ def __mul__(self, other: NumberVar | int) -> StringVar:
|
|
"""Multiply the sequence by a number or an integer.
|
|
"""Multiply the sequence by a number or an integer.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -663,13 +626,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
|
|
|
|
return (self.split() * other).join()
|
|
return (self.split() * other).join()
|
|
|
|
|
|
- @overload
|
|
|
|
- def __rmul__(self, other: NumberVar | int) -> StringVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __rmul__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __rmul__(self, other: Any) -> StringVar:
|
|
|
|
|
|
+ def __rmul__(self, other: NumberVar | int) -> StringVar:
|
|
"""Multiply the sequence by a number or an integer.
|
|
"""Multiply the sequence by a number or an integer.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -762,17 +719,9 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
"""
|
|
"""
|
|
return self.split().reverse().join()
|
|
return self.split().reverse().join()
|
|
|
|
|
|
- @overload
|
|
|
|
def contains(
|
|
def contains(
|
|
self, other: StringVar | str, field: StringVar | str | None = None
|
|
self, other: StringVar | str, field: StringVar | str | None = None
|
|
- ) -> BooleanVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def contains( # pyright: ignore [reportOverlappingOverload]
|
|
|
|
- self, other: NoReturn, field: StringVar | str | None = None
|
|
|
|
- ) -> NoReturn: ...
|
|
|
|
-
|
|
|
|
- def contains(self, other: Any, field: Any = None) -> BooleanVar:
|
|
|
|
|
|
+ ) -> BooleanVar:
|
|
"""Check if the string contains another string.
|
|
"""Check if the string contains another string.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -790,13 +739,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
return string_contains_field_operation(self, other, field)
|
|
return string_contains_field_operation(self, other, field)
|
|
return string_contains_operation(self, other)
|
|
return string_contains_operation(self, other)
|
|
|
|
|
|
- @overload
|
|
|
|
- def split(self, separator: StringVar | str = "") -> ArrayVar[list[str]]: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def split(self, separator: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def split(self, separator: Any = "") -> ArrayVar[list[str]]:
|
|
|
|
|
|
+ def split(self, separator: StringVar | str = "") -> ArrayVar[list[str]]:
|
|
"""Split the string.
|
|
"""Split the string.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -809,13 +752,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
raise_unsupported_operand_types("split", (type(self), type(separator)))
|
|
raise_unsupported_operand_types("split", (type(self), type(separator)))
|
|
return string_split_operation(self, separator)
|
|
return string_split_operation(self, separator)
|
|
|
|
|
|
- @overload
|
|
|
|
- def startswith(self, prefix: StringVar | str) -> BooleanVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def startswith(self, prefix: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def startswith(self, prefix: Any) -> BooleanVar:
|
|
|
|
|
|
+ def startswith(self, prefix: StringVar | str) -> BooleanVar:
|
|
"""Check if the string starts with a prefix.
|
|
"""Check if the string starts with a prefix.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -828,13 +765,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
raise_unsupported_operand_types("startswith", (type(self), type(prefix)))
|
|
raise_unsupported_operand_types("startswith", (type(self), type(prefix)))
|
|
return string_starts_with_operation(self, prefix)
|
|
return string_starts_with_operation(self, prefix)
|
|
|
|
|
|
- @overload
|
|
|
|
- def endswith(self, suffix: StringVar | str) -> BooleanVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def endswith(self, suffix: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def endswith(self, suffix: Any) -> BooleanVar:
|
|
|
|
|
|
+ def endswith(self, suffix: StringVar | str) -> BooleanVar:
|
|
"""Check if the string ends with a suffix.
|
|
"""Check if the string ends with a suffix.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -847,13 +778,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
raise_unsupported_operand_types("endswith", (type(self), type(suffix)))
|
|
raise_unsupported_operand_types("endswith", (type(self), type(suffix)))
|
|
return string_ends_with_operation(self, suffix)
|
|
return string_ends_with_operation(self, suffix)
|
|
|
|
|
|
- @overload
|
|
|
|
- def __lt__(self, other: StringVar | str) -> BooleanVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __lt__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __lt__(self, other: Any):
|
|
|
|
|
|
+ def __lt__(self, other: StringVar | str) -> BooleanVar:
|
|
"""Check if the string is less than another string.
|
|
"""Check if the string is less than another string.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -867,13 +792,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
|
|
|
|
return string_lt_operation(self, other)
|
|
return string_lt_operation(self, other)
|
|
|
|
|
|
- @overload
|
|
|
|
- def __gt__(self, other: StringVar | str) -> BooleanVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __gt__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __gt__(self, other: Any):
|
|
|
|
|
|
+ def __gt__(self, other: StringVar | str) -> BooleanVar:
|
|
"""Check if the string is greater than another string.
|
|
"""Check if the string is greater than another string.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -887,13 +806,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
|
|
|
|
return string_gt_operation(self, other)
|
|
return string_gt_operation(self, other)
|
|
|
|
|
|
- @overload
|
|
|
|
- def __le__(self, other: StringVar | str) -> BooleanVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __le__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __le__(self, other: Any):
|
|
|
|
|
|
+ def __le__(self, other: StringVar | str) -> BooleanVar:
|
|
"""Check if the string is less than or equal to another string.
|
|
"""Check if the string is less than or equal to another string.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
@@ -907,13 +820,7 @@ class StringVar(Var[STRING_TYPE], python_types=str):
|
|
|
|
|
|
return string_le_operation(self, other)
|
|
return string_le_operation(self, other)
|
|
|
|
|
|
- @overload
|
|
|
|
- def __ge__(self, other: StringVar | str) -> BooleanVar: ...
|
|
|
|
-
|
|
|
|
- @overload
|
|
|
|
- def __ge__(self, other: NoReturn) -> NoReturn: ... # pyright: ignore [reportOverlappingOverload]
|
|
|
|
-
|
|
|
|
- def __ge__(self, other: Any):
|
|
|
|
|
|
+ def __ge__(self, other: StringVar | str) -> BooleanVar:
|
|
"""Check if the string is greater than or equal to another string.
|
|
"""Check if the string is greater than or equal to another string.
|
|
|
|
|
|
Args:
|
|
Args:
|