I think I should have used Cunningham's law instead of asking questions in [this post](discuss.python.org/t/pep-810-e). I suspect I would have gotten more people weighing in.

*Ahem* I hereby affirmatively state that the ONLY ergonomic way to functionally backport lazy imports would be to use a context manager. Even a *genius* could not come up with a better way.

Follow

I further contend that other than `contextlib.suppress`, there is no other situation where lazy imports in a context manager could be dangerous.

Though I will admit that there are also NO OTHER REASONS for putting lazy imports in a context manager. It's just the backwards compatibility use case and no others.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.