<div dir="ltr"><div class="markdown-here-wrapper" style="font-size:1em;font-family:Helvetica,arial,freesans,clean,sans-serif;color:rgb(34,34,34);background-color:rgb(255,255,255);border:none;line-height:1.2"><blockquote style="margin:1em 0px;border-left:4px solid rgb(221,221,221);padding:0px 1em;color:rgb(119,119,119);quotes:none">
<p style="margin:1em 0px">Slicing is a lot more important than some keyword. And design-wise, filling the numpy namespace with singletons for keyword to other things in that same namespace just makes no sense to me.</p>
</blockquote>
<p style="margin:1em 0px">At least from the perspective of discoverability, you could argue that string constants form a namespace of their won, and so growing the “string” namespace is not inherently better than growing any other. The main flaw in that comparison is that picking <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">np.never_copy</code> to be a singleton forever prevents us reusing that name to become a function.</p>
<p style="margin:1em 0px">Perhaps the solution is to use <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">np.NEVER_COPY</code> instead - that’s never going to clash with a function name we want to add in future, and using upper attributes as arguments in that way is pretty typical for python (<code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">subprocess.PIPE</code>, <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">socket.SOCK_STREAM</code>, etc…)</p>
<p style="margin:1em 0px">You could fairly argue that this approach is outdated in the face of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">enum.Enum</code> - in which case we could go for the more heavy-handed <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">np.CopyMode.NEVER</code>, which still has a unique enough case for name clashes with functions never to be an issue.</p>
<p style="margin:1em 0px">Eric</p>
<div title="MDH:Jmd0O8KgPHNwYW4gc3R5bGU9ImNvbG9yOiByZ2IoMzMsIDMzLCAzMyk7Ij5TbGljaW5nIGlzIGEg
bG90IG1vcmUgaW1wb3J0YW50IHRoYW4gc29tZSBrZXl3b3JkLiBBbmQgZGVzaWduLXdpc2UsIGZp
bGxpbmcgdGhlIG51bXB5IG5hbWVzcGFjZSB3aXRoIHNpbmdsZXRvbnMgZm9yIGtleXdvcmQgdG8g
b3RoZXIgdGhpbmdzIGluIHRoYXQgc2FtZSBuYW1lc3BhY2UganVzdCBtYWtlcyBubyZuYnNwO3Nl
bnNlIHRvIG1lLjwvc3Bhbj48YnI+PGJyPkF0IGxlYXN0IGZyb20gdGhlIHBlcnNwZWN0aXZlIG9m
IGRpc2NvdmVyYWJpbGl0eSwgeW91IGNvdWxkIGFyZ3VlIHRoYXQgc3RyaW5nIGNvbnN0YW50cyBm
b3JtIGEgbmFtZXNwYWNlIG9mIHRoZWlyIHdvbiwgYW5kIHNvIGdyb3dpbmcgdGhlICJzdHJpbmci
IG5hbWVzcGFjZSBpcyBub3QgaW5oZXJlbnRseSBiZXR0ZXIgdGhhbiBncm93aW5nIGFueSBvdGhl
ci4gVGhlIG1haW4gZmxhdyBpbiB0aGF0IGNvbXBhcmlzb24gaXMgdGhhdCBwaWNraW5nIGBucC5u
ZXZlcl9jb3B5YCB0byBiZSBhIHNpbmdsZXRvbiBmb3JldmVyIHByZXZlbnRzIHVzIHJldXNpbmcg
dGhhdCBuYW1lIHRvIGJlY29tZSBhIGZ1bmN0aW9uLjxkaXY+PGJyPjwvZGl2PjxkaXY+UGVyaGFw
cyB0aGUgc29sdXRpb24gaXMgdG8gdXNlIGBucC5ORVZFUl9DT1BZYCBpbnN0ZWFkIC0gdGhhdCdz
IG5ldmVyIGdvaW5nIHRvIGNsYXNoIHdpdGggYSBmdW5jdGlvbiBuYW1lIHdlIHdhbnQgdG8gYWRk
IGluIGZ1dHVyZSwgYW5kIHVzaW5nIHVwcGVyIGF0dHJpYnV0ZXMgYXMgYXJndW1lbnRzIGluIHRo
YXQgd2F5IGlzIHByZXR0eSB0eXBpY2FsIGZvciBweXRob24gKGBzdWJwcm9jZXNzLlBJUEVgLCBg
c29ja2V0LlNPQ0tfU1RSRUFNYCwgZXRjLi4uKTxicj48YnI+WW91IGNvdWxkIGZhaXJseSBhcmd1
ZSB0aGF0IHRoaXMgYXBwcm9hY2ggaXMgb3V0ZGF0ZWQgaW4gdGhlIGZhY2Ugb2YgYGVudW0uRW51
bWAgLSBpbiB3aGljaCBjYXNlIHdlIGNvdWxkIGdvIGZvciB0aGUgbW9yZSBoZWF2eS1oYW5kZWQg
YG5wLkNvcHlNb2RlLk5FVkVSYCwgd2hpY2ggc3RpbGwgaGFzIGEgdW5pcXVlIGVub3VnaCBjYXNl
IGZvciBuYW1lIGNsYXNoZXMgd2l0aCBmdW5jdGlvbnMgbmV2ZXIgdG8gYmUgYW4gaXNzdWUuPC9k
aXY+PGRpdj48YnI+PC9kaXY+PGRpdj5FcmljPC9kaXY+" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 9 Jan 2019 at 22:25 Ralf Gommers <<a href="mailto:ralf.gommers@gmail.com">ralf.gommers@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 dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Jan 7, 2019 at 11:30 AM Eric Wieser <<a href="mailto:wieser.eric%2Bnumpy@gmail.com" target="_blank">wieser.eric+numpy@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 class="m_-1793758865787865224gmail-m_4510333770971462232markdown-here-wrapper"><br><p style="margin:0px 0px 1.2em">@Ralf</p>
<blockquote style="margin:1.2em 0px;border-left:4px solid rgb(221,221,221);padding:0px 1em;color:rgb(119,119,119);quotes:none">
<p style="margin:0px 0px 1.2em">np.newaxis is not relevant here - it’s a simple alias for None, is just there for code readability, and is much more widely applicable than np.never_copy would be.</p>
</blockquote>
<p style="margin:0px 0px 1.2em">Is there any particular reason we chose to use <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">None</code>? If I were designing it again, I’d consider a singleton object with a better <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">__repr__</code></p></div></div></blockquote></div></div></div><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div>It stems from Numeric: <a href="https://mail.python.org/pipermail/python-list/2009-September/552203.html" target="_blank">https://mail.python.org/pipermail/python-list/2009-September/552203.html</a>. Note that the Python builtin slice also uses None, but that's probably due to Numeric using it first.</div><div><br></div><div>Agree that a singleton with a nice repr could be a better choice than None. The more important part of my comment was "widely applicable" though. Slicing is a lot more important than some keyword. And design-wise, filling the numpy namespace with singletons for keyword to other things in that same namespace just makes no sense to me.</div><div><br></div><div>Cheers,<br></div><div>Ralf</div><div><br></div><div> <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="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lrZSBgbXlfY3Vz
dG9tX2Z1bmN0aW9uKGFyciwgY29weT0uLi4pYCB0aGF0IGZvcndhcmRzIGl0cyBjb3B5IGFyZ3Vt
ZW50IHRvIGByZXNoYXBlYDwvc3Bhbj48L2Rpdj48ZGl2PjxzcGFuIHN0eWxlPSJjb2xvcjogcmdi
KDMzLCAzMywgMzMpOyI+PGJyPjwvc3Bhbj48L2Rpdj48ZGl2PjxzcGFuIHN0eWxlPSJjb2xvcjog
cmdiKDMzLCAzMywgMzMpOyI+RXJpYzwvc3Bhbj48L2Rpdj4=" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px"><br></div></div></div>
</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>