GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — bpo-43926: Cleaner metadata with PEP 566 JSON support. by jaraco · Pull Request #25565 · python/cpython Conversation
|
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| >>> wheel_metadata['Requires-Python'] # doctest: +SKIP | ||
| '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*' | ||
|
|
||
| ``PackageMetadata`` also presents a ``json`` attribute that returns |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is a Python 3.10 only feature and hence a versionadded directive can be added.
Slightly out of topic, are Distribution objects and metadata attribute immutable? Accessing json attribute from metadata objects repeats the computation though it looks like a computed once attribute so just curious if metadata attribute of Distribution, json attribute etc. can be made a cached_property.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 289665029e (also versionchanged for changes to the interpretation of the metadata).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
can be made a cached_property?
Although technically the PackageMetadata object is mutable, the protocol for it doesn't allow for mutation, so it's effectively immutable, so yes, a cached_property could be employed. Such an optimization may be premature, so I'm slightly inclined to defer that concern until a use-case presents itself. I don't feel strongly about it though and would likely accept a PR to importlib_metadata.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
fc87e54 to
a0d64c7
Compare
There was an error while loading. Please reload this page.
|
@warsaw I note also that while we intentionally consolidated |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2896650 to
a9463bd
Compare
|
In order to ensure this change is included in the 3.10 release, I'm merging now. Happy to troubleshoot or back out specific behaviors as needed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.