diff options
author | Matti Picus <matti.picus@gmail.com> | 2022-07-17 08:40:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-17 08:40:51 +0300 |
commit | af44af78f0b83afc0a77643eafb003a5988367d5 (patch) | |
tree | 943831ed6e5a5978b2db49e27cf6a1ea4afb4bfa /numpy/typing | |
parent | 41b56579ee53ffb543a5fedef027cfa8ca4576a5 (diff) | |
parent | 28c73af1b8d909e7d7b9df4ffc395609c68d02a2 (diff) | |
download | numpy-af44af78f0b83afc0a77643eafb003a5988367d5.tar.gz |
Merge pull request #21984 from BvB93/comparison
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.pyi | 9 |
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_ |