diff --git a/src/pendulum/__init__.py b/src/pendulum/__init__.py index 3863b760..3efc42f7 100644 --- a/src/pendulum/__init__.py +++ b/src/pendulum/__init__.py @@ -1,6 +1,7 @@ from __future__ import annotations import datetime as _datetime +import warnings from typing import Union from typing import cast @@ -336,6 +337,11 @@ def interval(start: DateTime, end: DateTime, absolute: bool = False) -> Interval Create an Interval instance. """ return Interval(start, end, absolute=absolute) + + +def period(*args, *kw) -> Interval: + warnings.warn("pendulum.period is renamed to pendulum.interval", DeprecationWarning) + return interval(*args, **kw) # Testing