Commit 942d8b0e by Tianqi Chen

[ATTR] More robust attr parsing (#33)

parent d781a57f
......@@ -202,8 +202,6 @@ class Tuple {
if (it != begin) os << ',';
os << *it;
}
// python style tuple
if (t.ndim() == 1) os << ',';
os << ']';
return os;
}
......
......@@ -94,7 +94,17 @@ class AttrDict(object):
value : bool
The result value
"""
return self[key] != "False"
lowercase = self[key].lower()
if lowercase == "1":
return True
elif lowercase == "0":
return False
elif lowercase == "true":
return True
elif lowercase == "false":
return False
else:
raise ValueError("Wrong bool format for key %s" % key)
def __repr__(self):
return str({k : self[k] for k in self.keys()})
......
Markdown is supported
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