Functions
_apply_test
2
bool
▼
Apply a test to a value.
_apply_test
2
bool
▼
def _apply_test(value: Any, test_name: str, *args: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
|
test_name |
str |
Returns
bool
_test_callable
1
bool
▼
Test if value is callable.
_test_callable
1
bool
▼
def _test_callable(value: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
Returns
bool
_test_defined
1
bool
▼
Test if value is defined (not None).
_test_defined
1
bool
▼
def _test_defined(value: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
Returns
bool
_test_divisible_by
2
bool
▼
Test if value is divisible by num.
_test_divisible_by
2
bool
▼
def _test_divisible_by(value: int, num: int) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
int |
|
num |
int |
Returns
bool
_test_eq
2
bool
▼
Test equality.
_test_eq
2
bool
▼
def _test_eq(value: Any, other: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
|
other |
Any |
Returns
bool
_test_even
1
bool
▼
Test if value is even.
_test_even
1
bool
▼
def _test_even(value: int) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
int |
Returns
bool
_test_ge
2
bool
▼
Test greater than or equal.
_test_ge
2
bool
▼
def _test_ge(value: Any, other: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
|
other |
Any |
Returns
bool
_test_gt
2
bool
▼
Test greater than.
_test_gt
2
bool
▼
def _test_gt(value: Any, other: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
|
other |
Any |
Returns
bool
_test_in
2
bool
▼
Test if value is in sequence.
_test_in
2
bool
▼
def _test_in(value: Any, seq: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
|
seq |
Any |
Returns
bool
_test_iterable
1
bool
▼
Test if value is iterable.
_test_iterable
1
bool
▼
def _test_iterable(value: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
Returns
bool
_test_le
2
bool
▼
Test less than or equal.
_test_le
2
bool
▼
def _test_le(value: Any, other: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
|
other |
Any |
Returns
bool
_test_lower
1
bool
▼
Test if string is lowercase.
_test_lower
1
bool
▼
def _test_lower(value: str) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
str |
Returns
bool
_test_lt
2
bool
▼
Test less than.
_test_lt
2
bool
▼
def _test_lt(value: Any, other: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
|
other |
Any |
Returns
bool
_test_mapping
1
bool
▼
Test if value is a mapping.
_test_mapping
1
bool
▼
def _test_mapping(value: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
Returns
bool
_test_ne
2
bool
▼
Test inequality.
_test_ne
2
bool
▼
def _test_ne(value: Any, other: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
|
other |
Any |
Returns
bool
_test_none
1
bool
▼
Test if value is None.
_test_none
1
bool
▼
def _test_none(value: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
Returns
bool
_test_number
1
bool
▼
Test if value is a number.
_test_number
1
bool
▼
def _test_number(value: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
Returns
bool
_test_odd
1
bool
▼
Test if value is odd.
_test_odd
1
bool
▼
def _test_odd(value: int) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
int |
Returns
bool
_test_sequence
1
bool
▼
Test if value is a sequence.
_test_sequence
1
bool
▼
def _test_sequence(value: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
Returns
bool
_test_string
1
bool
▼
Test if value is a string.
_test_string
1
bool
▼
def _test_string(value: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
Returns
bool
_test_upper
1
bool
▼
Test if string is uppercase.
_test_upper
1
bool
▼
def _test_upper(value: str) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
value |
str |
Returns
bool
_test_match
2
bool
▼
Test if string matches regex pattern.
Used by rejectattr/selectattr for filter…
_test_match
2
bool
▼
def _test_match(value: Any, pattern: str) -> bool
Test if string matches regex pattern.
Used by rejectattr/selectattr for filtering by regex pattern.
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
|
pattern |
str |
Returns
bool