how to duplicate array entries

Chris Rebert clp2 at rebertia.com
Mon Jan 11 05:31:41 EST 2010


On Mon, Jan 11, 2010 at 2:20 AM, Alf P. Steinbach <alfps at start.no> wrote:
> * Chris Rebert:
>> On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach <alfps at start.no> wrote:
>>> * Steven D'Aprano:
>>>> On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
>>>>> * Paul Rudin:
>>>>>> Sebastian <sebastian.langer at gmx.de> writes:
<snip>
>>>>> Using the term "array" accentuates and clarifies this most important
>>>>> aspect.
>>>>
>>>> But Python lists are designed to behave as lists.
>>>
>>> No, I'm sorry, they're not.
>>>
>>> A Python 'list' has de facto constant time indexing, or "random access".
>>>
>>> A linked list  --  what the informal "list" means in programming
>>
>> Eh, it's a bit context-dependent. The abstract data type definition is
>> a superset that includes both linked lists and dynamic arrays.
>
> Assuming you're talking about some abstract type definition that's in some
> PEP somewhere

No, I mean the computer science definition/term:
http://en.wikipedia.org/wiki/List_(computer_science)

>> FWIW, Java likewise uses "list" in its ADT sense.
>
> I'm sorry, I'm unfamiliar with that Java terminology (but then, reportedly,
> many Java programmers think that Java has "pass by reference", so nothing
> coming from that direction will surprise me very much!). The Java language
> specification has a section about arrays, none about lists AFAICS. Do you
> have a reference?

http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list