Skip to content

0.5.7

Choose a tag to compare

@eadwinCode eadwinCode released this 23 Nov 06:01
· 529 commits to main since this release
d5ffc77

What's Changed

# main.py
from ellar.common.utils.functional import SimpleLazyObject, LazyStrImport

class PythonWebFramework:
    def __init__(self) -> None:
        self.name = 'Ellar'


def _get_lazy_instance() -> PythonWebFramework:
    return PythonWebFramework()


lazy_python_framework = SimpleLazyObject(_get_lazy_instance)
lazy_python_framework_type_import = LazyStrImport("main:PythonWebFramework")

assert lazy_python_framework.name == "Ellar"
assert lazy_python_framework_type_import().name == "Ellar"

Full Changelog: 0.5.6...0.5.7