Changeset 161

Show
Ignore:
Timestamp:
05/17/02 18:16:01 (6 years ago)
Author:
sholloway
Message:

Bugfix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBFoundation/RBFoundation/WeakBind.py

    r142 r161  
    100100        if isinstance(other, BoundCallable): 
    101101            return (self.im_self == other.im_self) and (self.im_func == other.im_func)  
    102         else: return self == BoundCallable(other) 
     102        else:  
     103            return self == BoundCallable(other) 
     104 
     105    def __ne__(self, other): 
     106        return not self.__eq__(other) 
    103107 
    104108    def _DoCall(self, args, kw): 
     
    136140 
    137141    class _Test: 
     142        def you(self): 
     143            return self 
    138144        def me(self): 
    139145            return self 
     
    153159    assert(sys.getrefcount(a) == 2) 
    154160 
    155     assert(a.me() == b1()) 
    156     assert(a.me() == b2()) 
    157     assert(b1() == b2()) 
    158     assert(b2() == b1()) 
     161    assert(a.me == b1) 
     162    assert(a.me == b2) 
     163    assert(b1 == b2) 
     164    assert(b2 == b1) 
     165 
     166    b3 = BindCallable(a.you) 
     167    assert(not b1 == b3) 
     168    assert(b1 != b3) 
    159169 
    160170    del a