Re: missing? dictionary methods

2005-03-23 Thread Antoon Pardon
Op 2005-03-22, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 22 Mar 2005 07:40:50 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > [...] >>I also was under the impression that a particular part of >>my program almost doubled in execution time once I replaced >>the naive dictionary assignment with

Re: missing? dictionary methods

2005-03-22 Thread Bengt Richter
On 22 Mar 2005 07:40:50 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: [...] >I also was under the impression that a particular part of >my program almost doubled in execution time once I replaced >the naive dictionary assignment with these self implemented >methods. A rather heavy burden IMO for so

Re: missing? dictionary methods

2005-03-21 Thread Antoon Pardon
Op 2005-03-21, Terry Reedy schreef <[EMAIL PROTECTED]>: > > "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> For the moment I frequently come across the following cases. >> >> 1) Two files, each with key-value pairs for the same dictionary. >> However it is an error

Re: missing? dictionary methods

2005-03-21 Thread Greg Ewing
George Sakkis wrote: As for naming, I would suggest reset() instead of set(), to emphasize that the key must be there. make() is ok; other candidates could be add() or put(). How about 'new' and 'old'? -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand

Re: missing? dictionary methods

2005-03-21 Thread Chris Rebert (cybercobra)
Antoon Pardon wrote: > Well at least I find them missing. > > For the moment I frequently come across the following cases. > > 1) Two files, each with key-value pairs for the same dictionary. > However it is an error if the second file contains a key that > was not in the first file. > > In treati

Re: missing? dictionary methods

2005-03-21 Thread Terry Reedy
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > For the moment I frequently come across the following cases. > > 1) Two files, each with key-value pairs for the same dictionary. > However it is an error if the second file contains a key that > was not in the first fi

Re: missing? dictionary methods

2005-03-21 Thread Ron
On 21 Mar 2005 08:21:40 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >Well at least I find them missing. > >For the moment I frequently come across the following cases. > >1) Two files, each with key-value pairs for the same dictionary. >However it is an error if the second file contains a key th

Re: missing? dictionary methods

2005-03-21 Thread Antoon Pardon
Op 2005-03-21, Robert Kern schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> I would say the same reason that we have get. There is no >> reason to have a builtin get it is easily implemented >> like this: >> >> def get(dct, key, default): >> >> try: >> return dct[key] >> e

Re: missing? dictionary methods

2005-03-21 Thread Robert Kern
Antoon Pardon wrote: I would say the same reason that we have get. There is no reason to have a builtin get it is easily implemented like this: def get(dct, key, default): try: return dct[key] except KeyError: return default I would go even so far that there is more reason to

Re: missing? dictionary methods

2005-03-21 Thread Antoon Pardon
Op 2005-03-21, Robert Kern schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Well at least I find them missing. >> >> For the moment I frequently come across the following cases. >> >> 1) Two files, each with key-value pairs for the same dictionary. >> However it is an error if the second fi

Re: missing? dictionary methods

2005-03-21 Thread Robert Kern
Antoon Pardon wrote: Well at least I find them missing. For the moment I frequently come across the following cases. 1) Two files, each with key-value pairs for the same dictionary. However it is an error if the second file contains a key that was not in the first file. In treating the second file

Re: missing? dictionary methods

2005-03-21 Thread George Sakkis
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Well at least I find them missing. > > For the moment I frequently come across the following cases. > > 1) Two files, each with key-value pairs for the same dictionary. > However it is an error if the second file contains

missing? dictionary methods

2005-03-21 Thread Antoon Pardon
Well at least I find them missing. For the moment I frequently come across the following cases. 1) Two files, each with key-value pairs for the same dictionary. However it is an error if the second file contains a key that was not in the first file. In treating the second file I miss a 'set' met