Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
This is not a bug, it is part of the design of the language. Assignment in Python does not make a copy of lists, or any other object. In your sample code, p and l are two names for the same list, like "Devor Blake Daniels" and "dev40573" are two names for the same person (you). You can use slicing to make a copy of the list, or the copy module, or the list constructor. I don't understand your comment "when dealing with lists like s[][],slicing does not work". ---------- nosy: +steven.daprano _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38458> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com