Closed 5j9 closed 10 months ago
Thanks @5j9 for the patch. It's a breaking change for python jalali and we need a major release. what do you think @slashmili ? please add a changelog in https://github.com/slashmili/python-jalali/blob/main/CHANGELOG.md
True, requires a major version. I think(might be wrong) this error format was how the datetime in python2 used to work
Just to be clear, although this is a breaking change, but the behaviour for almost all usual cases has not changed at all. datetime.date.today() + 1
still raises TypeError: unsupported operand type(s) for +: 'datetime.date' and 'int'
.
NotImplemented
is just a special value that tells the interpreter to retry the operation on the other operand and if that fails too, then the interpreter will raise TypeError
as before.
The breaking behaviour may occur if:
jdatetime.date
class but they rely on date
to raise a TypeError and prevent the operation. An extremely unlikely scenario.date.__add__(object)
instead of date + object
and relying on the TypeError raised. More plausible.@slashmili I think we can merge it. what do you think?
@hramezani Yes!
I'd say we only bump the minor version and hope for the best, what do you think?
otherwise we have to keep this change until next major release which we don't have any plan to do so
@hramezani Yes!
I'd say we only bump the minor version and hope for the best, what do you think?
otherwise we have to keep this change until next major release which we don't have any plan to do so
Sounds good to me 👍
Thanks @5j9 🎉
This is how the built-in
date
anddatetime
work.closes #84