예제 #1
0
파일: Set.cs 프로젝트: zzkongfu/ironpython3
 public bool __contains__(object item)
 {
     if (!SetStorage.GetHashableSetIfSet(ref item))
     {
         // make sure we have a hashable item
         return(_items.ContainsAlwaysHash(item));
     }
     return(_items.Contains(item));
 }
예제 #2
0
파일: Set.cs 프로젝트: zzkongfu/ironpython3
        public void remove(object item)
        {
            bool   res;
            object hashableItem = item;

            if (SetStorage.GetHashableSetIfSet(ref hashableItem))
            {
                res = _items.Remove(hashableItem);
            }
            else
            {
                res = _items.RemoveAlwaysHash(hashableItem);
            }

            if (!res)
            {
                throw PythonOps.KeyError(item);
            }
        }
예제 #3
0
파일: Set.cs 프로젝트: zzkongfu/ironpython3
        public void discard(object item)
        {
            SetStorage.GetHashableSetIfSet(ref item);

            _items.Remove(item);
        }