Open sergioUjo opened 1 month ago
Thanks for posting! It might take a while before we look at your issue, so don't worry if there seems to be no feedback. We'll get to it.
Hi—it turns out this changed with release 1.34 due to upgrading to SWIG 4.2 (which was necessary to enable Python stable API). I've opened an issue with the SWIG people (https://github.com/swig/swig/issues/2987) to see if that's an intentional change.
In the meantime, if you want to compare with None
explicitly, the idiomatic if date is None
works.
Fixed on the SWIG side. We'll have to wait for the next SWIG release.
Moving the issue to the QuantLib-SWIG repo.
Thanks for posting! It might take a while before we look at your issue, so don't worry if there seems to be no feedback. We'll get to it.
Description:
I recently updated QuantLib from version 1.32 to 1.35, and noticed that a comparison in my code suddenly broke. The issue suggests that the eq method for QuantLib.Date may not be working as expected.
Steps to Reproduce:
Here's a minimal reproducible example:
Expected Behavior: The comparison ql_date == None should return False, indicating that the ql_date is not equal to None, as None is not a valid Date object.
Actual Behavior: Instead, the code raises the following error:
ValueError: invalid null reference in method 'Date_eq', argument 2 of type 'Date const &'