Skip to content

Commit

Permalink
[dtypes] Additional dtype bool check
Browse files Browse the repository at this point in the history
Closes G-Node#224

Disallow setting a value that cannot be
interpreted as boolean for a boolean DType.
  • Loading branch information
mpsonntag committed Feb 22, 2018
1 parent 3ff8b2e commit d510fc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions odml/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def boolean_get(string):
false = ["false", "0", False, "f"]
if string in false:
return False
return bool(string)

# disallow any values that cannot be interpreted as boolean.
raise ValueError

# Alias boolean_set to boolean_get. Both perform same function.

Expand Down

0 comments on commit d510fc5

Please # to comment.