diff -r 365b5e6163a6 Doc/faq/programming.rst --- a/Doc/faq/programming.rst Fri Jun 03 19:14:52 2016 +0000 +++ b/Doc/faq/programming.rst Fri Jun 03 17:00:47 2016 -0700 @@ -1174,11 +1174,23 @@ This looks correct if you print it:: +.. testsetup:: + + A = [[None] * 2] * 3 + +.. doctest:: + >>> A [[None, None], [None, None], [None, None]] But when you assign a value, it shows up in multiple places: +.. testsetup:: + + A = [[None] * 2] * 3 + +.. doctest:: + >>> A[0][0] = 5 >>> A [[5, None], [5, None], [5, None]] @@ -1665,9 +1677,9 @@ next freshly created object is allocated at the same position in memory. This is illustrated by this example: ->>> id(1000) +>>> id(1000) # doctest: +SKIP 13901272 ->>> id(2000) +>>> id(2000) # doctest: +SKIP 13901272 The two ids belong to different integer objects that are created before, and @@ -1676,9 +1688,9 @@ to the object: >>> a = 1000; b = 2000 ->>> id(a) +>>> id(a) # doctest: +SKIP 13901272 ->>> id(b) +>>> id(b) # doctest: +SKIP 13891296