Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:
This is expected behavior. Please read : https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects . Default values are defined when function is created and not for every function call and you are having a reference to the returned list that is mutated. Also please use a better name for default since list is a built-in datatype and can cause confusion. ---------- nosy: +xtreak _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36393> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com