Skip to content

Support containing `kwargs` in target function

Latest
Compare
Choose a tag to compare
@Borda Borda released this 11 Jun 09:32
· 48 commits to main since this release
bf57030

Expand usage of the target function has kwargs and uses kwargs.get.

class NewCls:
    def __init__(self, c: float, d: str = "abc", **kwargs):
        self.my_c = c
        self.my_d = d
        self.my_e = kwargs.get("e", 0.2)

class PastCls(NewCls):
    @deprecated(target=NewCls, deprecated_in="0.2", remove_in="0.4")
    def __init__(self, c: int, d: str = "efg", **kwargs):
        pass

Thanks to @jungbaepark