PEP 690: Lazy Imports Again

Thanks Greg and SC for considering the PEP, and for the clear rejection reasons.

I’m curious, if anyone is willing to follow up, whether the following changes to the proposed feature and implementation would sufficiently address these concerns to be worth consideration as a new PEP (understanding here that I’m not asking for any official SC statement, just perspectives from individual SC members or anyone else):

  • lazy imports only by explicit keyword marker, mitigating both the “fragmentation” and “unexpected error sources” issues since the feature would be always explicitly and locally opt-in by the author of the import statement
  • implementation confined to a dict subclass that is used only for module dictionaries, and only if the module contains lazy imports

Thanks,

Carl

1 Like