public void CanBorrowFromNewReference() { var dict = new PyDict(); NewReference reference = Runtime.PyDict_Items(dict.Handle); try { PythonException.ThrowIfIsNotZero(Runtime.PyList_Reverse(reference)); } finally { reference.Dispose(); } }
public void MoveToPyObject_SetsNull() { var dict = new PyDict(); NewReference reference = Runtime.PyDict_Items(dict.Handle); try { Assert.IsFalse(reference.IsNull()); using (reference.MoveToPyObject()) Assert.IsTrue(reference.IsNull()); } finally { reference.Dispose(); } }