5 Oct 20:14
porting pycxx and pysvn to python 3.0 hit a problem
From: Barry Scott <barry <at> barrys-emacs.org>
Subject: porting pycxx and pysvn to python 3.0 hit a problem
Newsgroups: gmane.comp.python.devel
Date: 2008-10-05 18:18:18 GMT
Subject: porting pycxx and pysvn to python 3.0 hit a problem
Newsgroups: gmane.comp.python.devel
Date: 2008-10-05 18:18:18 GMT
I have a version of PyCXX ported to python 3.0 rc1 and its passing
its tests.
I'm porting pysvn to python 3.0 rc1 and hit an odd problem.
Given this dict:
wc_status_kind_map = {
pysvn.wc_status_kind.added: 'A',
pysvn.wc_status_kind.replaced: 'R',
pysvn.wc_status_kind.unversioned: '?',
}
This fails:
wc_status_kind_map[ pysvn.wc_status_kind.unversioned ]
With:
KeyError: <wc_status_kind.unversioned>
Clearly I have a bug in the implementation of pysvn.wc_status_kind and
could do with some suggestions on what to check please.
I've assumed that if my objects support tp_hash and tp_compare
they can be used as keys to a dictionary. My test scripts shows
hash() and cmp() working.
Why does "key in wc_status_kind_wc" work when I use an object returned
by keys() by not when I use pysvn.wc_status_kind.unversioned?
(Continue reading)
RSS Feed