From a9ae4ed3687aed75cf1aff048c0d8db6444af6c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 24 Apr 2022 16:07:03 +0200 Subject: [PATCH] Drop special __repr__ from Parseable mixin 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 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mkosi/backend.py b/mkosi/backend.py index c7a6bac16..b63f3bd8d 100644 --- a/mkosi/backend.py +++ b/mkosi/backend.py @@ -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) -- 2.47.2