public void CanBorrowFromNewReference()
        {
            var          dict      = new PyDict();
            NewReference reference = Runtime.PyDict_Items(dict.Handle);

            try
            {
                PythonException.ThrowIfIsNotZero(Runtime.PyList_Reverse(reference));
            }
            finally
            {
                reference.Dispose();
            }
        }
예제 #2
0
        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();
            }
        }