Often when I'm doing interactive prototyping I find myself wanting to check whether two arrays are sharing a copy of the same data.

It seems like there ought to be a concise way to do that, but right now seems like the only way is with a little function like this:

def same_base(a,b):
    ab = a.base
    if ab is None: ab = a
    bb = b.base
    if bb is None: bb = b
    return ab is bb   

is there some easier built-in way?  Does the above function even cover all the bases? (so to speak...)

It would be easier if a non-copy array pointed to itself as base rather than 'None'.  Then you could just check a.base == b.base.

--bb
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to