On 2021-06-16 18:32:46 +0200, Dieter Maurer wrote: > Chris Angelico wrote at 2021-6-16 02:20 +1000: > >On Wed, Jun 16, 2021 at 2:18 AM Dieter Maurer <die...@handshake.de> wrote: > >> As far as I know, there are no guarantees are the language level. > >> There are some (partially documented) implementation details > >> for CPython (which is just one possible implementation). > > > >Yes there are - plenty of them :) The example I gave is a language > >guarantee. > > Would you point to the documentation location where this is guaranteed?
I think it's in https://docs.python.org/3/reference/expressions.html#atom-identifiers | When the name is bound to an object, evaluation of the atom yields that object. So in x = whatever a_list = [x for _ in range(3)] you get a list of 3 references to the same object, not 3 references to 3 different copies of that object. hp -- _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | h...@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"
signature.asc
Description: PGP signature
-- https://mail.python.org/mailman/listinfo/python-list