Commit 6783003e authored by Francois Keith's avatar Francois Keith
Browse files

Correct the method objectToString and the handling of collections.

This corrects the issue detailed here:
https://github.com/jrl-umi3218/dynamic-graph-python/issues/2

Solution found by Florent Lamiraux.
parent 801b57e9
......@@ -101,12 +101,12 @@ def objectToString(obj) :
- an integer,
- a boolean,
"""
if (isinstance(obj, collections.Iterable)) :
if (hasattr (obj, "__iter__")) :
# matrix or vector
if len(obj) is 0 :
return ""
else :
if (isinstance(obj[0], collections.Iterable)) :
if (hasattr(obj[0], "__iter__")) :
#matrix
return matrixToString(obj)
else :
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment