Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -101,12 +101,12 @@ def objectToString(obj) : ...@@ -101,12 +101,12 @@ def objectToString(obj) :
- an integer, - an integer,
- a boolean, - a boolean,
""" """
if (isinstance(obj, collections.Iterable)) : if (hasattr (obj, "__iter__")) :
# matrix or vector # matrix or vector
if len(obj) is 0 : if len(obj) is 0 :
return "" return ""
else : else :
if (isinstance(obj[0], collections.Iterable)) : if (hasattr(obj[0], "__iter__")) :
#matrix #matrix
return matrixToString(obj) return matrixToString(obj)
else : else :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment