Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > tuples vs lists

Reply
Thread Tools

tuples vs lists

 
 
worzel
Guest
Posts: n/a
 
      01-08-2005
I get what the difference is between a tuple and a list, but why would I
ever care about the tuple's immuutability?
Also, do you say 'too-ple' or 'chu-ple' - if you get my drift. (tomato or
tomato kind of thing)
TIA


 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      01-08-2005
worzel a écrit :
> I get what the difference is between a tuple and a list, but why would I
> ever care about the tuple's immuutability?


Because, from a purely pratical POV, only an immutable object can be
used as kay in a dict. So you can use tuples for 'composed key'.

Bruno
 
Reply With Quote
 
 
 
 
Steve Horsley
Guest
Posts: n/a
 
      01-08-2005
worzel wrote:
> I get what the difference is between a tuple and a list, but why would I
> ever care about the tuple's immuutability?


Mainly for security and speed. Many library functions return info by returning
a reference to an internally held tuple, and could be damaged / compromised
/ corrupted if that internal data was modified by malicious code. If tuples
were mutable (lists) then it would be necessary to return a copy instead.

> Also, do you say 'too-ple' or 'chu-ple' - if you get my drift. (tomato or
> tomato kind of thing)


Try 'Two-pull'.

Steve
 
Reply With Quote
 
worzel
Guest
Posts: n/a
 
      01-08-2005
Cheers - thanks for the feedback guys - pretty much answers the question for
me.

'Two-Pull' it is then, thanks.


"Steve Horsley" <> wrote in message
news:croqtg$qo0$...
> worzel wrote:
>> I get what the difference is between a tuple and a list, but why would I
>> ever care about the tuple's immuutability?

>
> Mainly for security and speed. Many library functions return info by
> returning
> a reference to an internally held tuple, and could be damaged /
> compromised
> / corrupted if that internal data was modified by malicious code. If
> tuples
> were mutable (lists) then it would be necessary to return a copy instead.
>
>> Also, do you say 'too-ple' or 'chu-ple' - if you get my drift. (tomato or
>> tomato kind of thing)

>
> Try 'Two-pull'.
>
> Steve



 
Reply With Quote
 
Steve Holden
Guest
Posts: n/a
 
      01-08-2005
worzel wrote:

> Cheers - thanks for the feedback guys - pretty much answers the question for
> me.
>
> 'Two-Pull' it is then, thanks.
>

Well, it might be "Two-Pull" in American, but in English it's "tyoopl"
-- NOT "choopl" (blearch!). I've also heard people say "tuppl".

So, basically, say whatever you want. Language is about communication

you-say-tomato-ly y'rs - steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
 
Reply With Quote
 
Irmen de Jong
Guest
Posts: n/a
 
      01-08-2005
Steve Holden wrote:
> Well, it might be "Two-Pull" in American, but in English it's "tyoopl"
> -- NOT "choopl" (blearch!). I've also heard people say "tuppl".


Probably the same ones who attend Tuppl-ware parties.

--Irmen
 
Reply With Quote
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      01-08-2005
On Sat, 8 Jan 2005 21:00:27 +0800, "worzel" <> declaimed
the following in comp.lang.python:

> Also, do you say 'too-ple' or 'chu-ple' - if you get my drift. (tomato or
> tomato kind of thing)


I probably slaughter the word... tup-ell

--
> ================================================== ============ <
> | Wulfraed Dennis Lee Bieber KD6MOG <
> | Bestiaria Support Staff <
> ================================================== ============ <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.netcom.com/> <

 
Reply With Quote
 
Sean Dolan
Guest
Posts: n/a
 
      01-09-2005
worzel wrote:
> I get what the difference is between a tuple and a list, but why would I
> ever care about the tuple's immuutability?
> Also, do you say 'too-ple' or 'chu-ple' - if you get my drift. (tomato or
> tomato kind of thing)
> TIA
>
>

I use the Festival Speech Synthesis System to learn pronunciations
sometimes. The American english voice is quite accurate.

--
Sean Dolan
 
Reply With Quote
 
worzel
Guest
Posts: n/a
 
      01-09-2005
yes, "tyoopl" - thats what I meant by 'choo-ple' (not v good at the
phonetics)
As a scouse git (though living in Australia), I would definitely say
'tyoopl'.

"Steve Holden" <> wrote in message
news:w5WDd.69983$Jk5.66802@lakeread01...
> worzel wrote:
>
>> Cheers - thanks for the feedback guys - pretty much answers the question
>> for me.
>>
>> 'Two-Pull' it is then, thanks.
>>

> Well, it might be "Two-Pull" in American, but in English it's "tyoopl" --
> NOT "choopl" (blearch!). I've also heard people say "tuppl".
>
> So, basically, say whatever you want. Language is about communication
>
> you-say-tomato-ly y'rs - steve
> --
> Steve Holden http://www.holdenweb.com/
> Python Web Programming http://pydish.holdenweb.com/
> Holden Web LLC +1 703 861 4237 +1 800 494 3119



 
Reply With Quote
 
Gerrit
Guest
Posts: n/a
 
      01-10-2005
Steve Holden wrote:
> worzel wrote:
> >'Two-Pull' it is then, thanks.
> >

> Well, it might be "Two-Pull" in American, but in English it's "tyoopl"
> -- NOT "choopl" (blearch!). I've also heard people say "tuppl".
>
> So, basically, say whatever you want. Language is about communication


Or just write it down and don't say the word at all (-:

regards,
Gerrit, who actually says tüpel.

--
Weather in Lulea / Kallax, Sweden 10/01 10:20:
-12.0°C wind 0.0 m/s None (34 m above NAP)
--
In the councils of government, we must guard against the acquisition of
unwarranted influence, whether sought or unsought, by the
military-industrial complex. The potential for the disastrous rise of
misplaced power exists and will persist.
-Dwight David Eisenhower, January 17, 1961
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dictionaries with tuples or tuples of tuples Jon Reyes Python 18 02-19-2013 03:56 AM
Passing tuples of tuples to sqlite xera121 Python 8 09-30-2009 05:45 AM
tuples within tuples korovev76@gmail.com Python 12 10-27-2007 08:16 PM
Re: Lists of lists and tuples, and finding things within them Daniel Nogradi Python 3 11-10-2006 07:57 AM
Different tuples to one container? (One type of a pointer to point to different kinds of tuples?) fff_afafaf@yahoo.com C++ 5 10-05-2006 11:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57