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


Groups > comp.lang.python > #30524

Re: using "*" to make a list of lists with repeated (and independent) elements

Newsgroups comp.lang.python
Date 2012-09-29 11:50 -0700
References (3 earlier) <4657ccef-b910-4781-9ea8-005b4e15f219@googlegroups.com> <mailman.1461.1348699454.27098.python-list@python.org> <98034dee-0108-4099-bbdd-82f90e96d383@googlegroups.com> <b336c631-f197-47ca-bd71-48cda7f1a755@googlegroups.com> <mailman.1643.1348939161.27098.python-list@python.org>
Subject Re: using "*" to make a list of lists with repeated (and independent) elements
From 88888 Dihedral <dihedral88888@googlemail.com>
Message-ID <mailman.1652.1348944662.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Sunday, September 30, 2012 1:19:22 AM UTC+8, Ian wrote:
> On Sat, Sep 29, 2012 at 11:01 AM, 88888 Dihedral
> 
> <dihedral88888@googlemail.com> wrote:
> 
> >
> 
> > Don't you get it why I avoided the lambda one liner as a functon.
> 
> >
> 
> > I prefer the def way with a name chosen.
> 
> 
> 
> Certainly, but the Bresenham line algorithm is O(n), which is why it
> 
> is so superior to quicksort that is O(n log n).  Of course you might
> 
> try the Capo Ferro optimization, but I find that Thibault cancels out
> 
> Capo Ferro, don't you?

OK! I'll illustrate the lazy aspect of the python interpreter furthermore.

a=[1,2,3]
b=[a]*4 # different from a sliced copy as [list(a)]*4
print b
a[1]=4
print b
#-----
a=666 # type morphed
print b 

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


Thread

using "*" to make a list of lists with repeated (and independent) elements TP <TP@frenoespam.fr.invalid> - 2012-09-26 23:20 +0200
  Re: using "*" to make a list of lists with repeated (and independent) elements Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-26 15:39 -0600
  Re: using "*" to make a list of lists with repeated (and independent) elements Paul Rubin <no.email@nospam.invalid> - 2012-09-26 14:43 -0700
    Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-26 15:07 -0700
      Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-26 15:28 -0700
        Re: using "*" to make a list of lists with repeated (and independent) elements Tim Chase <python.list@tim.thechases.com> - 2012-09-26 17:45 -0500
          Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-26 15:53 -0700
          Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-26 15:53 -0700
          Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-27 14:24 -0700
          Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-27 14:24 -0700
          Re: using "*" to make a list of lists with repeated (and independent) elements Ramchandra Apte <maniandram01@gmail.com> - 2012-09-29 06:46 -0700
            Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-29 10:01 -0700
              Re: using "*" to make a list of lists with repeated (and independent) elements Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-29 11:18 -0600
                Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-29 11:50 -0700
                Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-29 11:50 -0700
              Re: using "*" to make a list of lists with repeated (and independent) elements Chris Angelico <rosuav@gmail.com> - 2012-09-30 03:41 +1000
            Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-29 10:01 -0700
          Re: using "*" to make a list of lists with repeated (and independent) elements Ramchandra Apte <maniandram01@gmail.com> - 2012-09-29 06:46 -0700
  Re: using "*" to make a list of lists with repeated (and independent) elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-26 14:45 -0700

csiph-web