Consider the following:
from decimal import Decimal
from numbers import Number, Complex, Real
z = Decimal(0)
# Expected: a == b == c == True
# Actual (Python 3.6.5):
a = isinstance(z, Number) # True
b = isinstance(z, Complex) # False
c = isinstance(z, Real) # False
Decimal
appears to implement everything that is needed to be considered Real
according to PEP3141, so what gives? Notably, fractions.Fraction
is correctly categorized by the above snippet (e.g. a == b == c == True
).