Sergey B Kirpichev <skirpic...@gmail.com> added the comment:

> It does not satisfy your assumptions in msg416056.

Yes, but does it fits to assumptions of the numbers module?  To be fair, there 
is even no requirement, that numerator/denominator are Integral instances 
(#25619 address also this).

BTW, it seems, the numpy integer types break my guess that numerator and 
denominator must have same types (I doubt that anyone uses numbers.Integral 
defaults, there are no tests for them in the CPython itself):
>>> a = numpy.int8(2); a
2
>>> type(a)
<class 'numpy.int8'>
>>> type(a.numerator)
<class 'numpy.int8'>
>>> type(a.denominator)
<class 'int'>
>>> type(a + a.denominator)
<class 'numpy.int64'>
>>> type(a.denominator + a)
<class 'numpy.int64'>
>>> type(a + a)
<class 'numpy.int8'>

If this is an expected behaviour for Integral types - feel free to close the 
bugreport.  Looks odd for me, however.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue47079>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to