Updating python dictionary

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sun Sep 7 19:12:33 EDT 2008


On Sun, 07 Sep 2008 15:59:52 -0700, John Machin wrote:

> On Sep 8, 8:42 am, "James Mills" <prolo... at shortcircuit.net.au> wrote:
>> On Mon, Sep 8, 2008 at 8:37 AM, John Machin <sjmac... at lexicon.net>
>> wrote:
> 
>> > There seems to be an implicit assumption in the answers so far that
>> > your mapping is a 1:1 mapping of all possible input keys.
>>
>> > If it doesn't include all possible input keys, answers will crash
>> > with a KeyError. If there are any many:1 elements in the mapping (for
>> > example, {'a': 'A', 'b': 'A'}), lossage happens. You may wish to code
>> > in some checks for this.
>>
>> You are quite right! But then he/she didn't ask for this right ? :)
>>
>>
> What do you mean by "this right"? Perhaps the Divine Right of OPs,
> managers, examiners, business analysts, etc never to give a complete
> spec up front and never to contemplate the consequences of Murphy's Law?


I *think* that what James Mills meant was:

"But then he/she didn't ask for this comma right?"



-- 
Steven



More information about the Python-list mailing list