| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/pythonnet/pythonnet/v3.2.0/src/embed_tests/ExtensionTypes.cs | [Back] [Original] |
using System;
using NUnit.Framework;
using Python.Runtime;
namespace Python.EmbeddingTest;
public class ExtensionTypes
{
[Test]
public void WeakrefIsNone_AfterBoundMethodIsGone()
{
using var makeref = Py.Import("weakref").GetAttr("ref");
var boundMethod = new UriBuilder().ToPython().GetAttr(nameof(UriBuilder.GetHashCode));
var weakref = makeref.Invoke(boundMethod);
boundMethod.Dispose();
Assert.That(weakref.Invoke().IsNone(), Is.True);
}
}
| Web Proxy Viewer | New URL | Original Page |