public string /*!*/ __repr__(CodeContext /*!*/ context) { return(String.Format("<cell at {0}: {1}>", IdDispenser.GetId(this), GetContentsRepr() )); }
private int CompareToWorker(List l) { // we need to lock both objects (or copy all of one's data w/ it's lock held, and // then compare, which is bad). Therefore we have a strong order for locking on // the lists int result; if (this.GetHashCode() < l.GetHashCode()) { lock (this) lock (l) result = Ops.CompareArrays(data, size, l.data, l.size); } else if (this.GetHashCode() != l.GetHashCode()) { lock (l) lock (this) result = Ops.CompareArrays(data, size, l.data, l.size); } else { // rare, but possible. We need a second opinion if (IdDispenser.GetId(this) < IdDispenser.GetId(l)) { lock (this) lock (l) result = Ops.CompareArrays(data, size, l.data, l.size); } else { lock (l) lock (this) result = Ops.CompareArrays(data, size, l.data, l.size); } } return(result); }
private string GetContentsRepr() { if (Value == Uninitialized.Instance) { return("empty"); } return($"{PythonTypeOps.GetName(Value)} object at 0x{IdDispenser.GetId(Value):X}"); }
private string GetContentsRepr() { if (Value == Uninitialized.Instance) { return("empty"); } return(String.Format("{0} object at {1}", PythonTypeOps.GetName(Value), IdDispenser.GetId(Value))); }
public virtual string /*!*/ __repr__(CodeContext /*!*/ context) { if (_func is BuiltinFunction bf) { return(String.Format("<method {0} of {1} objects>", PythonOps.Repr(context, bf.Name), PythonOps.Repr(context, DynamicHelpers.GetPythonTypeFromType(bf.DeclaringType).Name))); } return(String.Format("<classmethod object at {0}>", IdDispenser.GetId(this))); }
public WeakRefTracker(IWeakReferenceable target) { _targetId = IdDispenser.GetId(target); }
public string /*!*/ __repr__(CodeContext /*!*/ context) => $"<cell at 0x{IdDispenser.GetId(this):X}: {GetContentsRepr()}>";