Skip to content

2.2.4

Choose a tag to compare

@Lancetnik Lancetnik released this 13 Dec 19:24
· 206 commits to main since this release
13ba7b7

What's Changed

Now you can use FastDepends to inject dependencies to your class constructors and/or methods!

from fast_depends import Depends, inject

def get_var():
    return 1

class Class:
    @inject
    def __init__(self, a = Depends(get_var)) -> None:
        self.a = a

    @inject
    def calc(self, a = Depends(get_var)) -> int:
        return a + self.a

assert Class().calc() == 2

Full Changelog: 2.2.3...2.2.4