<div dir="ltr">Dear all,<div>I have a question about the behaviour of </div><div><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black"><br></code></div><div><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">y </code><code class="gmail-python gmail-keyword" style="font-stretch:normal;font-size:17px;white-space:pre;font-weight:bold;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,102,153)">=</code><span style="color:rgb(81,81,81);font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;white-space:pre"> </span><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">np.array(x, copy</code><code class="gmail-python gmail-keyword" style="font-stretch:normal;font-size:17px;white-space:pre;font-weight:bold;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,102,153)">=</code><code class="gmail-python gmail-color1" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:gray">False</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">, dtype</code><code class="gmail-python gmail-keyword" style="font-stretch:normal;font-size:17px;white-space:pre;font-weight:bold;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,102,153)">=</code><code class="gmail-python gmail-string" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:blue">'float32'</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">)</code><br></div><div><div><br></div><div>when x is a memmap. If we check the memmap attribute of mmap</div><div><code class="gmail-python gmail-functions" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(255,20,147)"><br></code></div><div><code class="gmail-python gmail-functions" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(255,20,147)">print</code><span style="color:rgb(81,81,81);font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;white-space:pre"> </span><code class="gmail-python gmail-string" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:blue">"mmap attribute"</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">, y._mmap</code><br></div><div><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:17px;white-space:pre;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black"><br></code></div>numpy tells us that y is not a memmap.</div><div>But the following code snippet crashes the python interpreter</div><div><br></div><div><div class="gmail-line gmail-number1 gmail-index0 gmail-alt2" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-comments" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,130,0)"># opens the memmap</code></div><div class="gmail-line gmail-number2 gmail-index1 gmail-alt1" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">with </code><code class="gmail-python gmail-functions" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(255,20,147)">open</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">(filename,</code><code class="gmail-python gmail-string" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:blue">'r+b'</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">) as f:</code></div><div class="gmail-line gmail-number3 gmail-index2 gmail-alt2" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-spaces" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline">      </code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">mm </code><code class="gmail-python gmail-keyword" style="font-stretch:normal;font-weight:bold;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,102,153)">=</code> <code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">mmap.mmap(f.fileno(),</code><code class="gmail-python gmail-value" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,153,0)">0</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">)</code></div><div class="gmail-line gmail-number4 gmail-index3 gmail-alt1" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-spaces" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline">      </code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">x </code><code class="gmail-python gmail-keyword" style="font-stretch:normal;font-weight:bold;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,102,153)">=</code> <code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">np.frombuffer(mm, dtype</code><code class="gmail-python gmail-keyword" style="font-stretch:normal;font-weight:bold;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,102,153)">=</code><code class="gmail-python gmail-string" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:blue">'float32'</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">)</code></div><div class="gmail-line gmail-number5 gmail-index4 gmail-alt2" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"> </div><div class="gmail-line gmail-number6 gmail-index5 gmail-alt1" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-comments" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,130,0)"># builds an array from the memmap, with the option copy=False</code></div><div class="gmail-line gmail-number7 gmail-index6 gmail-alt2" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">y </code><code class="gmail-python gmail-keyword" style="font-stretch:normal;font-weight:bold;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,102,153)">=</code> <code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">np.array(x, copy</code><code class="gmail-python gmail-keyword" style="font-stretch:normal;font-weight:bold;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,102,153)">=</code><code class="gmail-python gmail-color1" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:gray">False</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">, dtype</code><code class="gmail-python gmail-keyword" style="font-stretch:normal;font-weight:bold;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,102,153)">=</code><code class="gmail-python gmail-string" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:blue">'float32'</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">)</code></div><div class="gmail-line gmail-number8 gmail-index7 gmail-alt1" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-functions" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(255,20,147)">print</code> <code class="gmail-python gmail-string" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:blue">"before"</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">, y</code></div><div class="gmail-line gmail-number9 gmail-index8 gmail-alt2" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"> </div><div class="gmail-line gmail-number10 gmail-index9 gmail-alt1" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-comments" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(0,130,0)"># closes the file</code></div><div class="gmail-line gmail-number11 gmail-index10 gmail-alt2" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">mm.close()</code></div><div class="gmail-line gmail-number12 gmail-index11 gmail-alt1" style="font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:17px;color:rgb(81,81,81);border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;float:none;height:auto;line-height:1.1em;margin:0px;outline:0px;overflow:visible;padding:0px 1em;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;white-space:pre"><code class="gmail-python gmail-functions" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:rgb(255,20,147)">print</code> <code class="gmail-python gmail-string" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:blue">"after"</code><code class="gmail-python gmail-plain" style="font-stretch:normal;font-size:1em;line-height:1.1em;font-family:Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;direction:ltr;display:inline;color:black">, y</code></div></div><div><br></div><div>In my code I use memmaps to share read-only objects when doing parallel processing</div><div>and the behaviour of np.array, even if not consistent, it's desirable.</div><div>I share scipy sparse matrices over many processes and if np.array would make a copy</div><div>when dealing with memmaps this would force me to rewrite part of the sparse matrices</div><div>code.</div><div>Would it be possible in the future releases of numpy to have np.array check, </div><div>if copy is false, if y is a memmap and in that case return a full memmap object</div><div>instead of slicing it?</div><div><br></div><div>Best wishes</div><div>Isaia</div><div><br></div><div>P.S. A longer account of the issue may be found on my university blog</div><div><a href="http://www.im.ufrj.br/nisoli/blog/?p=131">http://www.im.ufrj.br/nisoli/blog/?p=131</a><br></div><div><br></div><div>-- <br><div class="gmail_signature">Isaia Nisoli<br><br></div>
</div></div>