Vulwsztyn

joined 2 years ago
[–] Vulwsztyn@programming.dev 3 points 1 week ago

This is only a Draft for now though

[–] Vulwsztyn@programming.dev 1 points 1 week ago

Yeah, but you can also write it like I proposed which is less boilerplaty and gives the same advantages

 

Hi, I recently realised one can use immutable default arguments to avoid a chain of:

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.

[–] Vulwsztyn@programming.dev 2 points 5 months ago* (last edited 5 months ago)

sick fun, but I learned a fair bit

[–] Vulwsztyn@programming.dev 3 points 2 years ago* (last edited 2 years ago) (2 children)

Read the 1st comment under 1st link, 2nd link os about something different, 4th links is about something absolutely different. **