Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79794

A bug?

X-Received by 10.236.228.202 with SMTP id f70mr20737985yhq.28.1414425718767; Mon, 27 Oct 2014 09:01:58 -0700 (PDT)
X-Received by 10.50.79.170 with SMTP id k10mr239929igx.12.1414425718528; Mon, 27 Oct 2014 09:01:58 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!u7no513463qaz.1!news-out.google.com!ks2ni4879igb.0!nntp.google.com!h15no240293igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Mon, 27 Oct 2014 09:01:57 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=117.197.201.189; posting-account=qP9eogkAAACSPuz6gcfJ5O576rRyAAMK
NNTP-Posting-Host 117.197.201.189
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <f491d969-7405-4017-b9c4-e1cb52a70280@googlegroups.com> (permalink)
Subject A bug?
From "umatrp@gmail.com" <trsexgl@gmail.com>
Injection-Date Mon, 27 Oct 2014 16:01:58 +0000
Content-Type text/plain; charset=ISO-8859-1
Lines 12
Xref csiph.com comp.lang.python:79794

Show key headers only | View raw


I use python 3.4.0 version. In the course of developing / running a python program, I have encountered a problem. I have reproduced below a simple program to bring it out.
 

>>> d = [[0]*3]*4
>>> dd = [1,2,3,4,5,6,7,8,9,10,11,12]
>>> for i in range(4):
...   for j in range(3): d[i][j] = dd[i*3+j]
... 
>>> d
[[10, 11, 12], [10, 11, 12], [10, 11, 12], [10, 11, 12]]
>>> 
d is not transferred to dd as expected?
Of course I can use 'append' & do my job (less elegantly though).

Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

A bug? "umatrp@gmail.com" <trsexgl@gmail.com> - 2014-10-27 09:01 -0700
  Re: A bug? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-10-27 17:17 +0100
  Re: A bug? Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-27 10:26 -0600
  Re: A bug? Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-28 00:36 +0000
    Re: A bug? Rustom Mody <rustompmody@gmail.com> - 2014-10-27 18:12 -0700
      Re: A bug? Chris Angelico <rosuav@gmail.com> - 2014-10-28 12:25 +1100
        Re: A bug? Rustom Mody <rustompmody@gmail.com> - 2014-10-27 19:13 -0700
    Re: A bug? Joshua Landau <joshua@landau.ws> - 2014-10-28 01:29 +0000
      Re: A bug? Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-29 02:17 +0000
        What for -- for?  (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 20:22 -0700
          Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-28 23:16 -0500
          Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-28 23:23 -0500
            Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 21:40 -0700
              Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-28 23:59 -0500
                Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 22:15 -0700
                Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-29 00:39 -0500
                Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 23:11 -0700
                Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-29 01:18 -0500
                Finding way around ABCs (was What for -- for? (was A bug?)) Rustom Mody <rustompmody@gmail.com> - 2014-10-30 10:01 -0700
                Re: Finding way around ABCs (was What for -- for? (was A bug?)) Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-30 11:09 -0600
                Re: Finding way around ABCs (was What for -- for? (was A bug?)) Rustom Mody <rustompmody@gmail.com> - 2014-10-30 10:16 -0700
                Re: Finding way around ABCs (was What for -- for? (was A bug?)) Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-30 11:11 -0600
          Re: What for -- for? (was A bug?) Ben Finney <ben+python@benfinney.id.au> - 2014-10-29 16:27 +1100
          Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-29 00:42 -0500
            Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 22:57 -0700
          Re: What for -- for? (was A bug?) Ben Finney <ben+python@benfinney.id.au> - 2014-10-29 17:02 +1100
          Re: What for -- for? (was A bug?) Joshua Landau <joshua@landau.ws> - 2014-10-30 17:21 +0000
            Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-30 10:41 -0700

csiph-web