Completed
Pull Request — master (#58)
by Jace
02:38
created

NameMixin.__ne__()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
1
"""Shared base classes and mixins."""
2
3
4 1
class NameMixin:
5
    """Mixin class for objects identified by their name."""
6
7 1
    def __str__(self):
8 1
        return str(self.name)
9
10 1
    def __eq__(self, other):
11 1
        return str(self).lower() == str(other).lower()
12
13 1
    def __ne__(self, other):
14 1
        return not self.__eq__(other)
15
16 1
    def __lt__(self, other):
17
        return str(self).lower() < str(other).lower()
18