Mercurial > hg > tvii
annotate tvii/iterable.py @ 42:38aa9098bf2d
derivative of sigmoid
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Mon, 04 Sep 2017 14:34:00 -0700 |
parents | 0149be5a984c |
children |
rev | line source |
---|---|
21
0149be5a984c
[iterable] add function to tell True/False if argument is an iterable
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
1 def isiterable(x): |
0149be5a984c
[iterable] add function to tell True/False if argument is an iterable
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
2 try: |
0149be5a984c
[iterable] add function to tell True/False if argument is an iterable
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
3 iter(x) |
0149be5a984c
[iterable] add function to tell True/False if argument is an iterable
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
4 return True |
0149be5a984c
[iterable] add function to tell True/False if argument is an iterable
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
5 except TypeError: |
0149be5a984c
[iterable] add function to tell True/False if argument is an iterable
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
6 return False |