Passed
Push — master ( 4e3c8a...b68652 )
by Max
01:11
created

structured_data._adt.ordering._set_ordering()   A

Complexity

Conditions 2

Size

Total Lines 9
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 2
nop 4
1
"""Helpers for reasoning about ordering methods."""
2
3
4
def _ordering_options_are_valid(
5
    *, eq: bool, order: bool  # pylint: disable=invalid-name
6
):
7
    if order and not eq:
8
        raise ValueError("eq must be true if order is true")
9
10
11
def _can_set_ordering(*, can_set: bool):
12
    if not can_set:
13
        raise ValueError("Can't add ordering methods if equality methods are provided.")
14
    return True
15