<div dir="ltr">constants are easier to support for autocompletion than strings.  My current env (emacs) will (usually) autocomplete the former, but not the latter.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 10, 2019 at 2:21 PM Feng Yu <<a href="mailto:rainwoodman@gmail.com">rainwoodman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Todd,</div><div><br></div><div>I agree a flag is more suitable than classes.</div><div><br></div><div>I would add another bonus of a flag than a function argument is to avoid massive contamination of function signatures for a global variation of behavior that affects many functions. </div></div><div dir="ltr"><div></div><div><br></div><div>Yu<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 9, 2019 at 11:34 PM Todd <<a href="mailto:toddrjen@gmail.com" target="_blank">toddrjen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Mon, Jan 7, 2019, 14:22 Feng Yu <<a href="mailto:rainwoodman@gmail.com" target="_blank">rainwoodman@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi, <br></div><div><br></div><div>Was it ever brought up the possibility of a new array class (ndrefonly, ndview) that is strictly no copy?<br></div><div><br></div><div>All operations on ndrefonly will return ndrefonly and if the operation cannot be completed without making a copy, it shall throw an error.</div><div><br></div><div>On the implementation there are two choices if we use subclasses:</div><div><br></div><div>- ndrefonly can be a subclass of ndarray. The pattern would be subclass limiting functionality of super, but ndrefonly is a ndarray.<br></div><div>- ndarray as a subclass of ndarray. Subclass supplements functionality of super. : ndarray will not throw an error when a copy is necessary. However ndarray is not a ndarray.</div><div><br></div><div>If we want to be wild they do not even need to be subclasses of each other, or maybe they shall both be subclasses of something more fundamental. <br></div><div></div><div><br></div><div></div><div></div><div>- Yu</div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I would prefer a flag for this.  Someone can make an array read-only by setting `arr.flags.writable=False`.  So along those lines, we could have a `arr.flags.copyable` flag that if set to `False` would result in an error of any operation tried to copy the data.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote></div></div></div>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div>