[Pythonmac-SIG] cross-platform puzzle

Bob Ippolito bob at redivi.com
Tue Feb 22 03:17:58 CET 2005


On Feb 21, 2005, at 9:12 PM, Kevin Ollivier wrote:

> On Feb 21, 2005, at 4:49 PM, Charles Hartman wrote:
>
>> This may be the wrong list for this question. Send me away if so, but 
>> I thought I'd try here first.
>>
>> I'm building Mac and Windows versions of an application with a 
>> dictionary as one main data structure. A dialog box lets the user 
>> type a string which is then used to change the value associated with 
>> one of the keys, or to generate a new key-value pair. At least if the 
>> pair is new, on Windows the test
>> 		if word in self.Dict:
>> 			newvalue = self.Dict[word]
>
> Out of curiosity, have you tried the has_key() dictionary method, like 
> "if self.Dict.has_key(word):"?

I wouldn't go down that road, I'm pretty confident that this isn't a 
bug in Python :)

-bob



More information about the Pythonmac-SIG mailing list