title: How to test for pointer equality in Python ctypes?
body: <p>If I have the following C library</p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdint.h&gt;
  
  int64_t* foo(int64_t *x) {
      return x;
  }
  </code></pre>
  <p>and I invoke the function from Python ctypes like so:</p>
  <pre class="lang-py prettyprint-override"><code>ptr = (ctypes.c_int64 * 100)()
  rval = api.foo(ptr)
  </code></pre>
  <p>Naively I'd assume I can just <code>assertEqual(rval, ptr)</code>, but that fails. Printing <code>rval</code> and  <code>ptr</code> respectively I get</p>
  <pre><code>&lt;reference_project.LP_c_longlong object at 0x0000021A563BBDC0&gt;
  &lt;tests.c_longlong_Array_100 object at 0x0000021A563BBF40&gt;
  </code></pre>
  <p>How can I compare <code>ptr</code> and <code>rval</code> for equality from Python?</p>