mnmelo / lazy_import

A module for lazy loading of Python modules
Other
86 stars 29 forks source link

Ujson import doesn't work #26

Open CuboidRaptor opened 1 year ago

CuboidRaptor commented 1 year ago

Code I used: (reproduce)

import lazy_import
ujson = lazy_import.lazy_module("ujson")
print(dir(ujson))
# Returns ['__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__']
ujson.dump()
# AttributeError

Ujson when lazy imported is basically blank. This works with many other libraries, just not ujson. Lazy_import version 0.2.2, Windows 10, Python 3.11.4