diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2009-11-15 02:42:03 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2009-11-15 02:42:03 +0000 |
commit | aa7ab26d14f340c23d92a54fe5ede99b398e3323 (patch) | |
tree | 918a6f025e7342bf45be7d3f1fb5e39c19c70729 /numpy/polynomial/polyutils.py | |
parent | 7d5b7ebd1d8e2a61c735a3db31a316d76975261d (diff) | |
download | numpy-aa7ab26d14f340c23d92a54fe5ede99b398e3323.tar.gz |
Add any function for python < 2.5.
Diffstat (limited to 'numpy/polynomial/polyutils.py')
-rw-r--r-- | numpy/polynomial/polyutils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/polynomial/polyutils.py b/numpy/polynomial/polyutils.py index 0edaeba38..e81275e91 100644 --- a/numpy/polynomial/polyutils.py +++ b/numpy/polynomial/polyutils.py @@ -65,6 +65,15 @@ class PolyBase(object) : pass # +# We need the any function for python < 2.5 +# +def any(iterable) : + for element in iterable: + if element : + return True + return False + +# # Helper functions to convert inputs to 1d arrays # def trimseq(seq) : |