Avoiding boilerplate by using immutable default arguments
Avoiding boilerplate by using immutable default arguments
vulwsztyn.codeberg.page
Avoiding boilerplate by using immutable default arguments in Python - Artur Mostowski
Hi, I recently realised one can use immutable default arguments to avoid a chain of:
python
def append_to(element, to=None): if to is None: to = []
at the beginning of each function with default argument for set, list, or dict.