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

Miro Hrončok notifications at github.com
Mon Oct 12 14:14:56 UTC 2020


@hroncok 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.

-- 
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_r503325494
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201012/7ca9fc9d/attachment.html>


More information about the Rpm-maint mailing list