| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/pythonnet/pythonnet/v3.2.1/src/embed_tests/TestPyIter.cs | [Back] [Original] |
using System.Linq;
using System.Text;
using NUnit.Framework;
using Python.Runtime;
namespace Python.EmbeddingTest
{
class TestPyIter
{
[Test]
public void KeepOldObjects()
{
using (Py.GIL())
using (var testString = new PyString("hello world! !$%&/()=?"))
{
PyObject[] chars = testString.ToArray();
Assert.IsTrue(chars.Length > 1);
string reconstructed = string.Concat(chars.Select(c => c.As()));
Assert.That(reconstructed, Is.EqualTo(testString.As()));
}
}
}
}
| Web Proxy Viewer | New URL | Original Page |