summaryrefslogtreecommitdiff
path: root/numpy/typing
diff options
context:
space:
mode:
authorBas van Beek <43369155+BvB93@users.noreply.github.com>2022-07-14 14:33:47 +0200
committerBas van Beek <43369155+BvB93@users.noreply.github.com>2022-07-14 14:33:56 +0200
commit28c73af1b8d909e7d7b9df4ffc395609c68d02a2 (patch)
treeab642eb041a8bfd1f765e5070d52c1571d4dc16b /numpy/typing
parent2d7559243a3474b58950336b5159afa085acf473 (diff)
downloadnumpy-28c73af1b8d909e7d7b9df4ffc395609c68d02a2.tar.gz
MAINT,TYP: Add object-overloads for the `np.generic` rich comparisons
Diffstat (limited to 'numpy/typing')
-rw-r--r--numpy/typing/tests/data/reveal/comparisons.pyi9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/typing/tests/data/reveal/comparisons.pyi b/numpy/typing/tests/data/reveal/comparisons.pyi
index ecd8ea690..9b32f4057 100644
--- a/numpy/typing/tests/data/reveal/comparisons.pyi
+++ b/numpy/typing/tests/data/reveal/comparisons.pyi
@@ -1,4 +1,6 @@
import numpy as np
+import fractions
+import decimal
c16 = np.complex128()
f8 = np.float64()
@@ -25,6 +27,13 @@ AR.setflags(write=False)
SEQ = (0, 1, 2, 3, 4)
+# object-like comparisons
+
+reveal_type(i8 > fractions.Fraction(1, 5)) # E: Any
+reveal_type(i8 > [fractions.Fraction(1, 5)]) # E: Any
+reveal_type(i8 > decimal.Decimal("1.5")) # E: Any
+reveal_type(i8 > [decimal.Decimal("1.5")]) # E: Any
+
# Time structures
reveal_type(dt > dt) # E: bool_