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

Chris Angelico rosuav at gmail.com
Sat Sep 29 13:41:04 EDT 2012


On Sun, Sep 30, 2012 at 3:18 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> On Sat, Sep 29, 2012 at 11:01 AM, 88888 Dihedral
> <dihedral88888 at 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?

Unless ...

class Agrippa(object):
    students = []
    def __init__(self):
        students.append(self)

enemy = Agrippa()

ChrisA
(maybe I'm pushing this a bit too far)



More information about the Python-list mailing list