[Pythonmac-SIG] cross-platform puzzle
Charles Hartman
charles.hartman at conncoll.edu
Tue Feb 22 01:49:51 CET 2005
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]
fails even though, in the debugger, the string I see for 'word' is
identical to one of the keys now visible in self.Dict. This is in
Windows only; the Mac version works fine.
The dialog box is making the proper return on both platforms, and the
new key-value pair is being inserted into the dictionary. I haven't yet
checked what happens if the key was an existing one and only the value
is changed, and I suppose that might turn out to be the crucial
question. But either way, I'm very puzzled to find a cross-platform
disparity in this area. What am I missing?
Charles Hartman
Professor of English, Poet in Residence
http://cherry.conncoll.edu/cohar
http://villex.blogspot.com
More information about the Pythonmac-SIG
mailing list