summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2021-05-10 06:26:17 +0200
committerGitHub <noreply@github.com>2021-05-10 06:26:17 +0200
commitd3434a0508cdeefb1c7f1c5095d57cef30e8e6b0 (patch)
tree59b22eed7b092849eebcc55d4880cfbdf4c4f418 /numpy
parent6b4f7763268337a17a86631965e5b56d8e3bb403 (diff)
parentc00091e4265f5eaabc943c6990c65903522c6e45 (diff)
downloadnumpy-d3434a0508cdeefb1c7f1c5095d57cef30e8e6b0.tar.gz
Merge pull request #18961 from yashasvimisra2798/doc_fixit
DOC: add note and examples to `isrealobj` docstring
Diffstat (limited to 'numpy')
-rw-r--r--numpy/lib/type_check.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py
index 383fbda3c..56afd83ce 100644
--- a/numpy/lib/type_check.py
+++ b/numpy/lib/type_check.py
@@ -364,6 +364,19 @@ def isrealobj(x):
--------
iscomplexobj, isreal
+ Notes
+ -----
+ The function is only meant for arrays with numerical values but it
+ accepts all other objects. Since it assumes array input, the return
+ value of other objects may be True.
+
+ >>> np.isrealobj('A string')
+ True
+ >>> np.isrealobj(False)
+ True
+ >>> np.isrealobj(None)
+ True
+
Examples
--------
>>> np.isrealobj(1)