Revision: 6128
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6128&view=rev
Author:   efiring
Date:     2008-09-28 03:07:04 +0000 (Sun, 28 Sep 2008)

Log Message:
-----------
fixed cbook.flatten so its docstring example works
Previously, flatten(('a','b')) triggered infinite recursion.

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

Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py    2008-09-28 00:44:08 UTC (rev 
6127)
+++ trunk/matplotlib/lib/matplotlib/cbook.py    2008-09-28 03:07:04 UTC (rev 
6128)
@@ -318,7 +318,10 @@
         return fh, opened
     return fh
 
-def flatten(seq, scalarp=is_scalar):
+def is_scalar_or_string(val):
+    return is_string_like(val) or not iterable(val)
+
+def flatten(seq, scalarp=is_scalar_or_string):
     """
     this generator flattens nested containers such as
 


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