The readme says in the TODO list that x = Int(5); x.set('bad') should error. It does, this has already been fixed.
However you can still set an Int to be a bool, e.g. x = Int(5); x.set(True). This is because isinstance(True, int) == True`. Historical reasons why are given in this SO post.
This should be solved one of two ways:
- Prevent setting an
Int with a bool value
- Convert the bool to int on set
I think either is fine, as long as the reasoning for the choice is detailed in the readme
The readme says in the TODO list that
x = Int(5); x.set('bad')should error. It does, this has already been fixed.However you can still set an
Intto be abool, e.g.x = Int(5); x.set(True). This is becauseisinstance(True, int) ==True`. Historical reasons why are given in this SO post.This should be solved one of two ways:
Intwith a bool valueI think either is fine, as long as the reasoning for the choice is detailed in the readme