Add forward referencing of symbol imports, similar to existing module forward references to break import recursion with "from X import Y" style references

You might be interested in PEP 690; discussion thread at PEP 690: Lazy Imports Again

The primary motivation is reducing startup cost for large applications by avoiding unnecessary imports, but it implements exactly the kind of “lazy placeholder” you are asking for here, so as a side effect it does eliminate most import cycle problems too.

3 Likes