3 ms·
That's a cool trick! Depending on your use case though it might not go far enough since the new "type" is really just an integer with an assert. It won't be pic
by benrutter 3y ago
That's a cool trick! Depending on your use case though it might not go far enough since the new "type" is really just an integer with an assert. It won't be picked up by static type checkers and there's nothing stopping you doing this:
```
x = N(2)
x -= 10
```
I think x still winds up being less than 0 here?
Its probably easier just to add an "assert" with a friendly message at the start of the log function.