]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Drop special __repr__ from Parseable mixin 957/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 24 Apr 2022 14:07:03 +0000 (16:07 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 24 Apr 2022 14:07:03 +0000 (16:07 +0200)
We want to override __str__, and we also did __repr__, but there doesn't
seem to be any particular reason for this.

mkosi/backend.py

index c7a6bac16f382e8c5164bb21ef893edb61d85520..b63f3bd8d741a98587cd9be1c41aa5a1bbb239fc 100644 (file)
@@ -90,13 +90,10 @@ ARG_DEBUG: Set[str] = set()
 class Parseable:
     "A mix-in to provide conversions for argparse"
 
-    def __repr__(self) -> str:
+    def __str__(self) -> str:
         """Return the member name without the class name"""
         return cast(str, getattr(self, "name"))
 
-    def __str__(self) -> str:
-        return self.__repr__()
-
     @classmethod
     def from_string(cls: Any, name: str) -> Any:
         """A convenience method to be used with argparse"""
@@ -256,8 +253,6 @@ class OutputFormat(Parseable, enum.Enum):
     def has_fs_compression(self) -> bool:
         return self.is_squashfs() or self.is_btrfs()
 
-    def __repr__(self) -> str:
-        return Parseable.__repr__(self)
     def __str__(self) -> str:
         return Parseable.__str__(self)
 
@@ -265,8 +260,6 @@ class ManifestFormat(Parseable, enum.Enum):
     json      = "json"       # the standard manifest in json format
     changelog = "changelog"  # human-readable text file with package changelogs
 
-    def __repr__(self) -> str:
-        return Parseable.__repr__(self)
     def __str__(self) -> str:
         return Parseable.__str__(self)