On Fri, Sep 6, 2013 at 10:19 AM, James Bergstra <bergstrj@iro.umontreal.ca> wrote:
Hi, could someone help me understand why this assertion fails?

def test_is(self):
    a = np.empty(1)
    b = np.empty(1)
    if a.data is not b.data:
        assert id(a.data) != id(b.data) # <-- fail

I'm trying to write an alternate may_share_memory function.


id seems not as advertised:

In [22]: for i in range(10): print id(a.data)
66094640
66095792
66095792
66095792
66095792
66095792
66094640
66094640
66094640
66094640

Not sure why.

Chuck