public object Contains(object o) { // promote sets to FrozenSet's for contains checks (so we get a hash code) o = SetHelpers.GetHashableSetIfSet(o); Ops.Hash(o);// make sure we have a hashable item return(Ops.Bool2Object(items.ContainsKey(o))); }
public void remove([NotNull] SetCollection o) { var set = SetHelpers.GetHashableSetIfSet(o); if (!_items.RemoveAlwaysHash(set)) { throw PythonOps.KeyError(o); } }
public bool __contains__(object value) { // promote sets to FrozenSets for contains checks (so we get a hash code) value = SetHelpers.GetHashableSetIfSet(value); if (_items.Count == 0) { PythonOps.Hash(DefaultContext.Default, value); // make sure we have a hashable item } return(_items.Contains(value)); }
public void Remove(object o) { o = SetHelpers.GetHashableSetIfSet(o); Ops.Hash(o); if (!items.ContainsKey(o)) { throw Ops.KeyError("{0}", o.ToString()); } items.Remove(o); }
public void Discard(object o) { o = SetHelpers.GetHashableSetIfSet(o); items.Remove(o); }