Commits

Bob Ippolito committed 4849e80

fix implementation of list-like remove

  • Participants
  • Parent commits f2e0ef4
  • Branches pyobjc-ancient

Comments (0)

Files changed (1)

Lib/objc/_convenience.py

     ('__contains__', lambda self, elem: bool(self.containsObject_(container_wrap(elem)))),
 )
 
-CONVENIENCE_METHODS['removeObject:'] = (
-    ('remove', lambda self, elem: self.removeObject_(container_wrap(elem))),
-)
-
 CONVENIENCE_METHODS['hash'] = (
     ('__hash__', lambda self: self.hash()),
 )
     self.removeObjectAtIndex_(idx)
     return rval
 
+def remove_removeObjectAtIndex_(self, obj):
+    idx = self.index(obj)
+    self.removeObjectAtIndex_(idx)
+
 CONVENIENCE_METHODS['removeObjectAtIndex:'] = (
+    ('remove', remove_removeObjectAtIndex_),
     ('pop', pop_removeObjectAtIndex_),
     ('__delitem__', __delitem__removeObjectAtIndex_),
 )