TIL #143 – Resolve a lazy import manually

Learn how to work around the Python machinery to resolve an explicit lazy import manually. A couple of articles ago I wrote about how you could inspect a lazy import . Apparently, you can use a similar trick to check the attributes and methods that a lazy import has: >>> lazy import json >>> dir(globals()["json"]) ['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__',…