Re: array and list

2008-01-18 Thread Paul Rubin
Travis Jensen <[EMAIL PROTECTED]> writes: > I wouldn't call it unfortunate. The list semantics follow LISP's > semantics far more closely than C's array semantics. I would hazard > to guess that they are called lists because that is what every > functional language calls them and this aspect of p

Re: array and list

2008-01-18 Thread Travis Jensen
On Jan 18, 2008, at 2:48 AM, [EMAIL PROTECTED] wrote: > J. Peng>why perl call it array and python call it list?< > > Unfortunate naming, I'd say. Calling list a dynamic array is silly, > despite all the things you may say about abstract data types having > the correct methods, etc. I wouldn't

Re: array and list

2008-01-18 Thread Paddy
> Paddy: > > > I guess 'under the hood' Python (& Perl?), arrays might be more like > > an implementation of what the C programmer might call a linked list, > > but even then there are differences as most linked list examples > > given in C tutorials are lists of the same type of object, > >

Re: array and list

2008-01-18 Thread bearophileHUGS
J. Peng>why perl call it array and python call it list?< Unfortunate naming, I'd say. Calling list a dynamic array is silly, despite all the things you may say about abstract data types having the correct methods, etc. Paddy: > I guess 'under the hood' Python (& Perl?), arrays might be more like

Re: array and list

2008-01-18 Thread Paddy
On Jan 18, 8:18 am, "J. Peng" <[EMAIL PROTECTED]> wrote: > > On Jan 18, 3:23 am, "J. Peng" <[EMAIL PROTECTED]> wrote: > > >> what's the difference between an array and a list in python? > >> I see list has all features of array in C or perl. > >> so please tell me.thanks. > > > If you are new to Py

Re: array and list

2008-01-18 Thread J. Peng
> On Jan 18, 3:23 am, "J. Peng" <[EMAIL PROTECTED]> wrote: > >> what's the difference between an array and a list in python? >> I see list has all features of array in C or perl. >> so please tell me.thanks. >> > > If you are new to Python, then where other languages may reach for an > 'ar

Re: array and list

2008-01-18 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 18 Jan 2008 15:05:23 +1100, Ben Finney wrote: > > In Python, 'list' is a basic built-in type. Python has no 'array' > > type [...] > Did you forget the array module? Yes. -- \"Always code as if the guy who ends up maintaining your c

Re: array and list

2008-01-18 Thread Paddy
On Jan 18, 3:23 am, "J. Peng" <[EMAIL PROTECTED]> wrote: > what's the difference between an array and a list in python? > I see list has all features of array in C or perl. > so please tell me.thanks. If you are new to Python, then where other languages may reach for an 'array', Python programs mi

Re: array and list

2008-01-17 Thread Steven D'Aprano
On Fri, 18 Jan 2008 15:05:23 +1100, Ben Finney wrote: > "J. Peng" <[EMAIL PROTECTED]> writes: > >> what's the difference between an array and a list in python? > > In Python, 'list' is a basic built-in type. Python has no 'array' type, > though that term is often used to refer to the 'array' typ

Re: array and list

2008-01-17 Thread Ben Finney
"J. Peng" <[EMAIL PROTECTED]> writes: > what's the difference between an array and a list in python? In Python, 'list' is a basic built-in type. Python has no 'array' type, though that term is often used to refer to the 'array' type defined in Numeric Python (which is not part of the standard lib

array and list

2008-01-17 Thread J. Peng
what's the difference between an array and a list in python? I see list has all features of array in C or perl. so please tell me.thanks. -- http://mail.python.org/mailman/listinfo/python-list