New GitHub issue #118761 from layday:<br>
<hr>
<pre>
`importlib.metadata` is often used for tasks that need to happen at import, e.g. to enumerate/load entry point plug-ins, so it might be worth seeing if we can cut down its own import time a bit more.
`importlib.metadata` imports `zipfile` at the top for a function that won't be called in the vast majority of cases. It also imports `importlib.abc`, which in turn imports `importlib.resources`, to subclass an ABC with a single, non-abstract method - I assume redefining the method in `importlib.metadata` would be harmless. Some other less frequently-used imports which are only accessed once or twice, such as `json`, could also be tucked away in their calling functions.
Split from #109653.
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/118761">View on GitHub</a>
<p>Labels: </p>
<p>Assignee: </p>