public override bool Contains(object key) { if (_hidden.Contains(key)) { return(false); } return(_data.ContainsKey(key)); }
public override bool Contains(object key) { if (_hidden.Contains(key)) { return(false); } string strKey = key as string; if (strKey != null) { return(_data.ContainsKey(SymbolTable.StringToId(strKey))); } else { return(_data.ContainsObjectKey(key)); } }
public override bool Contains(object key) { if (key is string && TryGetExtraValue((string)key, out object dummy)) { return(dummy != Uninitialized.Instance); } return(_storage.Contains(key)); }
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 override bool Remove(ref DictionaryStorage storage, object key) { if (_storage.Contains(key)) { lock (this) { if (storage == this) { var newStore = new CommonDictionaryStorage(); _storage.CopyTo(newStore); newStore.Remove(key); storage = newStore; return(true); } } // race, try again return(storage.Remove(ref storage, key)); } return(false); }
public override bool Contains(object key) { return(_storage.Contains(key)); }