/// <summary> /// Checks to see if the key exists in the dictionary. /// </summary> public override bool Contains(object key) { if (!PythonContext.IsHashable(key)) { throw PythonOps.TypeErrorForUnhashableObject(key); } return(TryGetValue(key, out _)); }
public override bool Contains(object key) { // make sure argument is valid, do not calculate hash if (PythonContext.IsHashable(key)) { return(false); } throw PythonOps.TypeErrorForUnhashableObject(key); }