http.client is only used to report a case of thrown Exception during init. It's not a general execution path, and it's not time-critical. Thus it makes sense to speed up cold starts by importing on-demand
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Implicit
import ssl
is happening here: https://github.com/python/cpython/blob/main/Lib/http/client.py#L1431http.client
is only used to report a case of thrown Exception during init. It's not a general execution path, and it's not time-critical. Thus it makes sense to speed up cold starts by importing on-demandBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.