From f1952cdebfd19893402e8680a181580befad0cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= <6774676+eumiro@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:24:35 +0000 Subject: [PATCH] Fix a few typos in comments/docs/strings (#737) --- docs/docs/limitations.md | 4 ++-- pendulum/__init__.py | 2 +- pendulum/date.py | 2 +- pendulum/datetime.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/limitations.md b/docs/docs/limitations.md index 7deff230..913aca1c 100644 --- a/docs/docs/limitations.md +++ b/docs/docs/limitations.md @@ -4,7 +4,7 @@ Even though the `DateTime` class is a subclass of `datetime`, there are some rare cases where it can't replace the native class directly. Here is a list (non-exhaustive) of the reported cases with a possible solution, if any: -* `sqlite3` will use the the `type()` function to determine the type of the object by default. To work around it you can register a new adapter: +* `sqlite3` will use the `type()` function to determine the type of the object by default. To work around it you can register a new adapter: ```python import pendulum @@ -13,7 +13,7 @@ Here is a list (non-exhaustive) of the reported cases with a possible solution, register_adapter(pendulum.DateTime, lambda val: val.isoformat(' ')) ``` -* `mysqlclient` (former `MySQLdb`) and `PyMySQL` will use the the `type()` function to determine the type of the object by default. To work around it you can register a new adapter: +* `mysqlclient` (former `MySQLdb`) and `PyMySQL` will use the `type()` function to determine the type of the object by default. To work around it you can register a new adapter: ```python import pendulum diff --git a/pendulum/__init__.py b/pendulum/__init__.py index 1f70f14f..43346e5c 100644 --- a/pendulum/__init__.py +++ b/pendulum/__init__.py @@ -261,7 +261,7 @@ def today(tz: str | Timezone = "local") -> DateTime: def tomorrow(tz: str | Timezone = "local") -> DateTime: """ - Create a DateTime instance for tommorow. + Create a DateTime instance for tomorrow. """ return today(tz).add(days=1) diff --git a/pendulum/date.py b/pendulum/date.py index 493ee4e0..5e69ec0f 100644 --- a/pendulum/date.py +++ b/pendulum/date.py @@ -560,7 +560,7 @@ def nth_of(self, unit: str, nth: int, day_of_week: WeekDay) -> Self: dt = cast("Self", getattr(self, f"_nth_of_{unit}")(nth, day_of_week)) if not dt: raise PendulumException( - f"Unable to find occurence {nth}" + f"Unable to find occurrence {nth}" f" of {WeekDay(day_of_week).name.capitalize()} in {unit}" ) diff --git a/pendulum/datetime.py b/pendulum/datetime.py index 9ffc85f5..d90f550e 100644 --- a/pendulum/datetime.py +++ b/pendulum/datetime.py @@ -496,7 +496,7 @@ def __repr__(self) -> str: # Comparisons def closest(self, *dts: datetime.datetime) -> Self: # type: ignore[override] """ - Get the farthest date from the instance. + Get the closest date to the instance. """ pdts = [self.instance(x) for x in dts] @@ -1013,7 +1013,7 @@ def nth_of(self, unit: str, nth: int, day_of_week: WeekDay) -> Self: dt = cast(Optional["Self"], getattr(self, f"_nth_of_{unit}")(nth, day_of_week)) if not dt: raise PendulumException( - f"Unable to find occurence {nth}" + f"Unable to find occurrence {nth}" f" of {WeekDay(day_of_week).name.capitalize()} in {unit}" )