Months

when_exactly.Months

Bases: when_exactly.core.custom_collection.CustomCollection[when_exactly._api.Month]

A collection of Month intervals.

Example
>>> import when_exactly as wnx
>>> months = wnx.Months([wnx.Month(2025, 1), wnx.Month(2025, 3)])
>>> len(months)
2
>>> months[0]
Month(2025, 1)

values property

Get the sorted list of unique intervals in this collection.

Returns:

Type Description
list[when_exactly.core.collection.CollectionT]

A sorted list of intervals.

__init__(values)

Initialize a Collection with the given intervals.

Parameters:

Name Type Description Default
values typing.Iterable[when_exactly.core.collection.CollectionT]

An iterable of intervals. Duplicates will be removed and the intervals will be sorted.

required