[Python-Dev] porting pycxx and pysvn to python 3.0 hit a problem
Barry Scott
barry at barrys-emacs.org
Tue Oct 7 21:53:37 CEST 2008
On Oct 5, 2008, at 22:49, Terry Reedy wrote:
> Barry Scott wrote:
>
>> for key in [pysvn.wc_status_kind.added,
>> pysvn.wc_status_kind.replaced,
>> pysvn.wc_status_kind.unversioned]:
>> print( '2 key', key, key in wc_status_kind_map, cmp( key,
>> pysvn.wc_status_kind.unversioned ), hash( key ) )
>> try:
>> print( '2 lookup', wc_status_kind_map[ key ] )
>> except:
>> print( '2 failed' )
>
>> 2 key added False 1 -586300914
>> 2 failed
>> 2 key replaced False 1 -586300911
>> 2 failed
>> 2 key unversioned False 0 -586300916
>> 2 failed
>
> Given that p.we.x seems to always return the same object (since the
> hashes, which which appear to be ids, are the same), an __eq__
> method (which gets called in preference to __cmp__), possibly
> inherited, that always return False is the only thing I can think
> of. (Hence Martin's question, I presume). I have no idea,
> however, how porting could make that happen.
The type is not derived so the __eq__ cannot be happening.
I guess I need to use gdb and figure out what is going on.
Barry
More information about the Python-Dev
mailing list