Title: Abstract methods in non-abstract imporlib.metadata.Distribution · Issue #419 · python/importlib_metadata · GitHub
Open Graph Title: Abstract methods in non-abstract imporlib.metadata.Distribution · Issue #419 · python/importlib_metadata
X Title: Abstract methods in non-abstract imporlib.metadata.Distribution · Issue #419 · python/importlib_metadata
Description: The empty methods read_text and locatate_file of Distribution class are decorated with abc.abstractmethod. But Distribution class doesn't have metaclass=abc.ABCMeta. PEP 3119, Introducing Abstract Base Classes, states.: The abstractmetho...
Open Graph Description: The empty methods read_text and locatate_file of Distribution class are decorated with abc.abstractmethod. But Distribution class doesn't have metaclass=abc.ABCMeta. PEP 3119, Introducing Abstract ...
X Description: The empty methods read_text and locatate_file of Distribution class are decorated with abc.abstractmethod. But Distribution class doesn't have metaclass=abc.ABCMeta. PEP 3119, Introducing Abstr...
Opengraph URL: https://github.com/python/importlib_metadata/issues/419
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Abstract methods in non-abstract imporlib.metadata.Distribution","articleBody":"The empty methods **read_text** and **locatate_file** of **Distribution** class are decorated with _abc.abstractmethod_. But _Distribution_ class doesn't have _metaclass=abc.ABCMeta_.\r\n\r\n[PEP 3119](https://peps.python.org/pep-3119/), Introducing Abstract Base Classes, states.:\r\n> The abstractmethod decorator should only be used inside a class body, and only for classes whose metaclass is (derived from) ABCMeta. \r\n\r\nConsidering the facts that methods **read_text** and **locate_file** are used in other methods of _Distribution_ class and both are empty, only things containing are docstrings, I think the author of the class intended to use the _abstractmethod_ functionality to enforce an implementation of the aforementioned methods. So, in my opinion, the _Distribution_ class should have _metaclass=abc.ABCMeta_.\r\n\r\n(Other possibility is that the aforementioned methods are intended as stubs. Then the _abstractmethod_ decorator may be deleted.)\r\n\r\nI've created the PR in case the issue is right, i.e. the class should contain _metaclass=abc.ABCMeta_.\r\n\r\n\r\n\u003c!-- gh-linked-prs -->\r\n### Linked PRs\r\n* python/cpython#100466\r\n\u003c!-- /gh-linked-prs -->\r\n","author":{"url":"https://github.com/busywhitespace","@type":"Person","name":"busywhitespace"},"datePublished":"2022-12-23T15:48:12Z","url":"https://github.com/python/importlib_metadata/issues/419"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9206d154-7e40-0bf7-c6aa-217dc3e8f4f2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C84A:22F2F8:D6D05:127FB4:6B0080D6 |
| html-safe-nonce | 49dfa510f72cb39c7b333c1f43d470454d9babe91615dc0be243d207258d91c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODRBOjIyRjJGODpENkQwNToxMjdGQjQ6NkIwMDgwRDYiLCJ2aXNpdG9yX2lkIjoiMTk1MzYwOTIyNTQ4NTcxMzYyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 10b4565539d842c70743e5ff25bcb63a1ec1fc919aef50fcff48a4e673042527 |
| hovercard-subject-tag | issue:1515695062 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/importlib_metadata/419/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e6c80259725168c7f34bb7ef6ab4a0a3be96b52c052c8168b0610e1da85861ea/python/importlib_metadata/issues/419 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e6c80259725168c7f34bb7ef6ab4a0a3be96b52c052c8168b0610e1da85861ea/python/importlib_metadata/issues/419 |
| og:image:alt | The empty methods read_text and locatate_file of Distribution class are decorated with abc.abstractmethod. But Distribution class doesn't have metaclass=abc.ABCMeta. PEP 3119, Introducing Abstract ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | busywhitespace |
| hostname | github.com |
| expected-hostname | github.com |
| None | 82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/importlib_metadata git https://github.com/python/importlib_metadata.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 306448340 |
| octolytics-dimension-repository_nwo | python/importlib_metadata |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 306448340 |
| octolytics-dimension-repository_network_root_nwo | python/importlib_metadata |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d1bc2aa1939001689f5ce935982c10a6138f745c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width