• [Python-announce] Late 1.0.0 - late bound arguments

    From =?UTF-8?Q?Juancarlo_A=C3=B1ez?=@[email protected] to comp.lang.python.announce on Sat Nov 11 14:43:22 2023
    From Newsgroup: comp.lang.python.announce

    *Late* provides decorators and functions to work around the issues that
    early binding of default argument values produces in Python.

    @latebinding
    def f(x: list[Any] = __([])) -> list[Any]:
    x.append(1)
    return x

    assert f() == [1]
    assert f() == [1]
    assert f() == [1]

    https://pypi.org/project/Late/
    --
    Juancarlo *AƱez*
    mailto:[email protected]
    --- Synchronet 3.20a-Linux NewsLink 1.114