Tuples and immutability
breamoreboy at yahoo.co.uk
Sat Mar 1 15:54:43 CET 2014
On 01/03/2014 06:16, Mark H. Harris wrote:
> On Friday, February 28, 2014 11:16:18 PM UTC-6, Ian wrote:
>> How would you propose doing that? Bear in mind that while Python
>> knows that tuples specifically are immutable, it doesn't generally
>> know whether a type is immutable.
> hi Ian, consider the problem... its a "cake" and "eat it too" scenario... you can't have your cake and eat it too....
> This is what I mean... the error message is telling the user that it cannot do what he has requested, and yet IT DID. You have one of two scenarios: 1) the message is arbitrarily lying and it really can assign an immutable's item... (and it did!) or 2) It really should NOT assign an immutables item (the message is truth) but the action was "allowed" anyway despite the protocol and accepted policy... in which case the two scenarios add up to a giant logical inconsistency... QED a bug.
> There really is no way to get around this from the average user's perspective. And therefore, this is going to come up again and again and again... because coders don't like unexpected logical inconsistencies.
> It is not helpful either to explain it away by knowing how the policy works under the covers... the average user of the python language should not have to understand the policy of the underlying substructure...
> 1) either they can't assign the list item of an immutable tuple type (and the action is a flaw, say bug
> 2) they really CAN set the immutable's list item type (which it did!) and the message is bogus.
> Its one way or the other.... we can't have our cake and eat it too... this is (one way or the other) a bug.
would you please be kind enough to use plain English... your use of
sentences like this... is starting to annoy me...
you're also using google groups... it doesn't wrap paragraphs
correctly... please read and action this
https://wiki.python.org/moin/GoogleGroupsPython... it does wrap
paragraphs correctly... it also prevents us seeing double line spacing...
do you get my drift???
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
This email is free from viruses and malware because avast! Antivirus protection is active.
More information about the Python-list