[Python-Dev] porting pycxx and pysvn to python 3.0 hit a problem

Terry Reedy tjreedy at udel.edu
Sun Oct 5 23:49:04 CEST 2008


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.

tjr



More information about the Python-Dev mailing list