QuantLib icon indicating copy to clipboard operation
QuantLib copied to clipboard

__eq__ Method Fails for QuantLib.Date with None Comparison

Open sergioUjo opened this issue 6 months ago • 2 comments

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:

import QuantLib as ql

ql_date = ql.Date(1, 1, 2021)

is_false = ql_date == None

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 &'

sergioUjo avatar Aug 05 '24 16:08 sergioUjo