Steven D'Aprano wrote:
I suggest that Python should raise warnings.RuntimeWarning (or similar?) when a function is defined with a default argument consisting of a list, dict or set. (This is not meant as an exhaustive list of all possible mutable types, but as the most common ones that I expect will trip up newbies.) The warning should refer to the relevant FAQ or section in the docs.

What do people think?

I don't see a chance for your proposal. How are you going to detect mutable objects? Custom types can be mutable as well as immutable.

Christian

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to