Skip to content

Equal between intervals #1

@StarBrand

Description

@StarBrand

When I define two Interval objects with the same start and end, these fail to be equals. My code:

expected = Interval(
    start=dt.datetime(year=2007, month=3, day=1, hour=13, tzinfo=dt.timezone.utc),
    end=dt.datetime(year=2008, month=5, day=11, hour=15, minute=30, tzinfo=dt.timezone.utc)
)
actual = Interval(
    start=dt.datetime(year=2007, month=3, day=1, hour=13, tzinfo=dt.timezone.utc),
    end=dt.datetime(year=2008, month=5, day=11, hour=15, minute=30, tzinfo=dt.timezone.utc)
)
print(expected == actual)  # This print false

However, other operators and comparison seems fine, like:

expected.start in actual  # This print true

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions