[Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

torsava notifications at github.com
Mon Oct 12 15:09:32 UTC 2020


@torsava commented on this pull request.



> +    @classmethod
+    def normalize_name(klass, name):
+        """https://www.python.org/dev/peps/pep-0503/#normalized-names"""
+        return re.sub(r'[-_.]+', '-', name).lower()
+
+    @classmethod
+    def legacy_normalize_name(klass, name):
+        """Like pkg_resources Distribution.key property"""
+        return re.sub(r'[-_]+', '-', name).lower()

> I wonder why it is a classmethod and not a staticmethod (when it does not use the "kalss" attribute at all). I would make it a property, but initialized value is fine as well.

It's also used outside of this class, so it can't be a property. But a static method/function makes sense.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#discussion_r503360841
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201012/01059fa5/attachment-0001.html>


More information about the Rpm-maint mailing list