*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]
_______________________________________________
Python-announce-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: [email protected]