Title: Should PackageMetadata.get be supported? · Issue #384 · python/importlib_metadata · GitHub
Open Graph Title: Should PackageMetadata.get be supported? · Issue #384 · python/importlib_metadata
X Title: Should PackageMetadata.get be supported? · Issue #384 · python/importlib_metadata
Description: This isn't a feature request. I'm looking for a quick clarification, so other folks who encounter python/typeshed#7767 have a definitive answer. In the wild, I've seen things like this: from importlib.metadata import metadata print(metad...
Open Graph Description: This isn't a feature request. I'm looking for a quick clarification, so other folks who encounter python/typeshed#7767 have a definitive answer. In the wild, I've seen things like this: from import...
X Description: This isn't a feature request. I'm looking for a quick clarification, so other folks who encounter python/typeshed#7767 have a definitive answer. In the wild, I've seen things like this:...
Opengraph URL: https://github.com/python/importlib_metadata/issues/384
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Should PackageMetadata.get be supported?","articleBody":"This isn't a feature request. I'm looking for a quick clarification, so other folks who encounter python/typeshed#7767 have a definitive answer.\r\n\r\n---\r\n\r\nIn the wild, I've seen things like this:\r\n\r\n```\r\nfrom importlib.metadata import metadata\r\nprint(metadata(\"bork\").get(\"Version\"))\r\n```\r\n\r\nBoth the [stdlib documentation](https://docs.python.org/3/library/importlib.metadata.html) and the [readthedocs documentation](https://importlib-metadata.readthedocs.io/en/latest/) never mention `.get()`, and `PackageMetadata` does not define it. Due to that, using it and running mypy returns `error: \"PackageMetadata\" has no attribute \"get\"`. I suspect I made a bad assumption when I used it, but if so it's one I've seen other folks make — so it seems worthwhile to get an explicit answer on whether leaving it out is deliberate.\r\n\r\n**So, my question is this:**\r\n\r\nIs `.get()` an implementation detail that folks latched on to and should migrate away from? Or should it be added to `PackageMetadata`?","author":{"url":"https://github.com/duckinator","@type":"Person","name":"duckinator"},"datePublished":"2022-06-01T18:05:36Z","url":"https://github.com/python/importlib_metadata/issues/384"}
| 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:d6534498-b147-3a4a-85d3-e3ecf53e7a74 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8AEC:1F5665:E4A84:133396:6B0080A3 |
| html-safe-nonce | 5129c66848b46cfcb79ce391ffc5d0a03594eda1a5d87f6da34bfe9e244b5f3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUVDOjFGNTY2NTpFNEE4NDoxMzMzOTY6NkIwMDgwQTMiLCJ2aXNpdG9yX2lkIjoiMjg3NjAzNjQ4MjYwOTQ3OTg0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 460f7a43744c4e72c2c5b4678e3d14a102893f2398ebd26f143fd6862b0aed48 |
| hovercard-subject-tag | issue:1256674214 |
| 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/384/issue_layout |
| twitter:image | https://opengraph.githubassets.com/37a088362c104bea1c4f802651db1faa51de88adf000c850b2a3cb2248f0a808/python/importlib_metadata/issues/384 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/37a088362c104bea1c4f802651db1faa51de88adf000c850b2a3cb2248f0a808/python/importlib_metadata/issues/384 |
| og:image:alt | This isn't a feature request. I'm looking for a quick clarification, so other folks who encounter python/typeshed#7767 have a definitive answer. In the wild, I've seen things like this: from import... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | duckinator |
| 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