datetime behaviour is not consistent with decimal and uuid
-- Can compare decimal with strings and numbers
tarantool> decimal.new(123) == '123'
---
- true
...
tarantool> decimal.new(123) == 123
---
- true
...
-- Can compare uuid with strings
tarantool> uuid.fromstr('744c5225-a962-40d2-a301-d401c43789eb') == '744c5225-a962-40d2-a301-d401c43789eb'
---
- true
...
--- Can't compare datetime with strings
tarantool> datetime.parse('2022-07-20T11:51:57.531005+0300') == '2022-07-20T11:51:57.531005+0300'
---
- false
...
We did this on purpose. Won't fix
We did this on purpose.
What is the purpose?
Reopened to bring into attention.
@Totktonada You can contact @Mons for details. The general meaning is that an implicit cast in this case (and in cases above) is worse than an explicit cast. Moreover, the more complex the type on which the implicit cast is performed, the higher the likelihood of encountering a problem.
I understand your point, but things don't look very complex here. There is a strict ordering. If not (a < b) and not (b < a) than a == b.