annotate wsgraph/utils.py @ 58:c4f551305a23 default tip

note http://marvl.infotech.monash.edu/webcola/
author Jeff Hammel <k0scist@gmail.com>
date Sun, 02 Aug 2015 08:14:20 -0700
parents f1f7a505e0d0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 """
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 utility functions that should be in core python
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 def isiterable(instance):
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 try:
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 iter(instance)
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 return True
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 except TypeError:
f1f7a505e0d0 __contains__ method
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 return False