<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 19, 2018 at 5:58 AM, Sylvain MARIE <span dir="ltr"><<a href="mailto:sylvain.marie@schneider-electric.com" target="_blank">sylvain.marie@schneider-electric.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> A thought just occurred to me. Maybe we should just add a Boolean class to numbers?<br>
<br>
</span>That would be great indeed<br>
<span class=""><br>
> It's a subclass of Integral, presumably. And normally only builtins.bool is registered with it. But np.bool can be added at the same point you register the other np integral types.<br>
<br>
</span>I would rather suggest to keep that Boolean ABC class independent of Integral (see proposal in first post) to let it remain 'pure', i.e. represent logical booleans only. However nothing prevents us to register python bool as a virtual subclass of *both* Integral and Boolean - while np.bool would be registered as a virtual subclass of Boolean only. This would reflect quite well the reality - the fact that python bool is both a Boolean and an Integer, while numpy bool is only a Boolean.<br></blockquote><div><br></div><div>OK, that could work. At this point I think you should just file an issue on <a href="http://bugs.python.org">bugs.python.org</a> (but since Python 3.7 is in feature freeze, expect this to be put on the 3.8 track).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
By the way, is there a reason for the name "Integral" (algebraic theory) instead of "Integer" (computer science) ? Would it be practically feasible to add "Integer" as an alias to "Integral" in the numbers package ?<br clear="all"></blockquote><div><br></div><div>Hm, perhaps Integral is an adjective, just like Boolean? Though it's also possible that it was simply a mistake. In general I don't like adding aliases for different spellings -- it violates TOOWTDI. If we decide that this really was a mistake we should go ahead and make Integer the recommended way and define Integral as an alias for backwards compatibility.<br></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>