Comment

Comment by StreamBright

Except that 90% of Python programmers fail to answer simple questions like:

Given:

    def extendList(val, list=[]):
        list.append(val)
        return list

What do the following print:

print(extendList(1))

print(extendList(1))

print(extendList(2))

print(extendList(3,[]))

I do not blame them. This sort of behavior is error-prone. You can make sure that you do not use such a code in production with code reviews but it would be also great to not having such things in the language.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton