Skip to content

Commit

Permalink
Change repr override class to a default mixin instead of Enum subclass
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeChannel authored and kageru committed Aug 18, 2020
1 parent bbc66cf commit b6bac1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vsutil/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
E = TypeVar('E', bound=Enum)


class _NoSubmoduleRepr(Enum):
class _NoSubmoduleRepr:
def __repr__(self):
"""Removes submodule name from standard repr, helpful since we re-export everything at the top-level."""
return '<%s.%s.%s: %r>' % (self.__module__.split('.')[0], self.__class__.__name__, self.name, self.value)


class Dither(str, _NoSubmoduleRepr):
class Dither(_NoSubmoduleRepr, str, Enum):
"""
Enum for `zimg_dither_type_e`.
"""
Expand All @@ -30,7 +30,7 @@ class Dither(str, _NoSubmoduleRepr):
"""Floyd-Steinberg error diffusion."""


class Range(int, _NoSubmoduleRepr):
class Range(_NoSubmoduleRepr, int, Enum):
"""
Enum for `zimg_pixel_range_e`.
"""
Expand Down

0 comments on commit b6bac1d

Please sign in to comment.