• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

davidfischer-ch / pytoolbox / 8520525711

02 Apr 2024 09:27AM UTC coverage: 67.51% (+0.4%) from 67.076%
8520525711

push

github

web-flow
Merge pull request #83 from davidfischer-ch/new-stuff

Publish code

156 of 178 new or added lines in 23 files covered. (87.64%)

373 existing lines in 18 files now uncovered.

7688 of 11388 relevant lines covered (67.51%)

1.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

38.71
/pytoolbox/enum.py
1
"""
2
Module related to enumeration.
3
"""
4
from __future__ import annotations
2✔
5

6
from typing import Any
2✔
7
import enum
2✔
8

9
__all__ = ['OrderedEnum']
2✔
10

11

12
class OrderedEnum(enum.Enum):
2✔
13
    """
14
    An enumeration both hash-able and ordered by value.
15

16
    Reference: https://docs.python.org/3/library/enum.html#orderedenum.
17
    """
18

19
    def __hash__(self) -> int:
2✔
20
        return hash(self.value)
×
21

22
    def __eq__(self, other: Any) -> bool:
2✔
NEW
23
        if type(self) is type(other):
×
24
            return self.value == other.value  # pylint:disable=comparison-with-callable
×
25
        return NotImplemented
×
26

27
    def __ge__(self, other: Any) -> bool:
2✔
NEW
28
        if type(self) is type(other):
×
29
            return self.value >= other.value  # pylint:disable=comparison-with-callable
×
30
        return NotImplemented
×
31

32
    def __gt__(self, other: Any) -> bool:
2✔
NEW
33
        if type(self) is type(other):
×
34
            return self.value > other.value  # pylint:disable=comparison-with-callable
×
35
        return NotImplemented
×
36

37
    def __le__(self, other: Any) -> bool:
2✔
NEW
38
        if type(self) is type(other):
×
39
            return self.value <= other.value  # pylint:disable=comparison-with-callable
×
40
        return NotImplemented
×
41

42
    def __lt__(self, other: Any) -> bool:
2✔
NEW
43
        if type(self) is type(other):
×
44
            return self.value < other.value  # pylint:disable=comparison-with-callable
×
45
        return NotImplemented
×
46

47
    def __ne__(self, other: Any) -> bool:
2✔
NEW
48
        if type(self) is type(other):
×
49
            return self.value != other.value  # pylint:disable=comparison-with-callable
×
50
        return NotImplemented
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc