Revision: 6385
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6385&view=rev
Author:   ryanmay
Date:     2008-11-10 18:59:18 +0000 (Mon, 10 Nov 2008)

Log Message:
-----------
Make iterable() and is_string_like() return True/False instead of 1/0.

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/cbook.py

Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py    2008-11-09 14:11:16 UTC (rev 
6384)
+++ trunk/matplotlib/lib/matplotlib/cbook.py    2008-11-10 18:59:18 UTC (rev 
6385)
@@ -261,16 +261,16 @@
 def iterable(obj):
     'return true if *obj* is iterable'
     try: len(obj)
-    except: return 0
-    return 1
+    except: return False
+    return True
 
 
 def is_string_like(obj):
     'return true if *obj* looks like a string'
-    if hasattr(obj, 'shape'): return 0
+    if hasattr(obj, 'shape'): return False
     try: obj + ''
-    except (TypeError, ValueError): return 0
-    return 1
+    except (TypeError, ValueError): return False
+    return True
 
 def is_sequence_of_strings(obj):
     """


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to