Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm talking about the following where we don't intend to do [] + [] but we feed some lists to some functions that do something to the lists and we end up with empty lists in some cases without inspecting the contents of a and b after we feed it to the functions. Why would you define a default argument of an empty list if you're not gonna check if it's a list and if it's empty?

    a = [1,2]
    someFunction(a)
    b = [3,4]
    someOtherFunction(b)
    a + b


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: