[issue32886] new Boolean ABC in numbers module + Integral>Integer renaming

2018-02-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Use <= for this operation. -- ___ Python tracker ___

[issue32886] new Boolean ABC in numbers module + Integral>Integer renaming

2018-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: > This one is common to both python bool and np.bool_. It's not, though. One of my examples was using `~` (`__invert__`) from the proposed ABC). And the behaviour of that function differs between NumPy and Python I think one of the rules

[issue32886] new Boolean ABC in numbers module + Integral>Integer renaming

2018-02-21 Thread Sylvain Marie
Sylvain Marie added the comment: @Mark: you are right. That's why the proposed ABC does NOT inherit from Integral/Integer and focuses on boolean logic in its simplest form (not, and, or, xor). This one is common to both python bool and np.bool_. @Serhiy:

[issue32886] new Boolean ABC in numbers module + Integral>Integer renaming

2018-02-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If a Boolean ABC includes __and__, __or__ and __xor__ which implement conjunction, disjunction and exclusive disjunction, shouldn't it include __le__, __gt__, __ge__ and __lt__? They implement other logical operations: material

[issue32886] new Boolean ABC in numbers module + Integral>Integer renaming

2018-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: > - register numpy bool ('np.bool_') as a virtual subclass of 'Boolean' only Be aware that np.bool_ behaves differently from Python's bool type in a number of ways. It may not make sense to have something that tries to abstract over both

[issue32886] new Boolean ABC in numbers module + Integral>Integer renaming

2018-02-21 Thread Sylvain Marie
Sylvain Marie added the comment: Thanks ! 1. > ok 2. > ok 3. > That's simply 'the latest state' in the discussion. I guess that having Boolean in numbers is better than it being in its own module, since it is consistent with the other ABCs (and bool is a

[issue32886] new Boolean ABC in numbers module + Integral>Integer renaming

2018-02-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: First off, link to discussion: https://groups.google.com/d/topic/python-ideas/-3QW3cxj3ko/discussion 1. bool is already a virtual subclass of Integral since it's an actual subclass of int (which is a virtual subclass of

[issue32886] new Boolean ABC in numbers module + Integral>Integer renaming

2018-02-20 Thread Sylvain Marie
New submission from Sylvain Marie : This issue is created following the discussion [Python-ideas] Boolean ABC similar to what's provided in the 'numbers' module. The following items are suggested: - adding a 'Boolean' ABC class to the 'numbers' module -