Changeset 161
- Timestamp:
- 05/17/02 18:16:01 (6 years ago)
- Files:
-
- trunk/RBFoundation/RBFoundation/WeakBind.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/RBFoundation/RBFoundation/WeakBind.py
r142 r161 100 100 if isinstance(other, BoundCallable): 101 101 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) 103 107 104 108 def _DoCall(self, args, kw): … … 136 140 137 141 class _Test: 142 def you(self): 143 return self 138 144 def me(self): 139 145 return self … … 153 159 assert(sys.getrefcount(a) == 2) 154 160 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) 159 169 160 170 del a
