Skip to content

Commit 11892cd

Browse files
committed
remove deprecated components, move itemized deltas to pure Python
1 parent 7e63843 commit 11892cd

52 files changed

Lines changed: 2925 additions & 10969 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# Changelog
22

3+
## 0.11.0 (unreleased)
4+
5+
**Breaking changes**
6+
7+
- Removed the ``DateDelta`` and ``DateTimeDelta`` classes,
8+
which were deprecated in 0.10.0.
9+
Use ``ItemizedDateDelta`` and ``ItemizedDelta`` instead.
10+
- Removed the ``years()``, ``months()``, ``weeks()``, ``days()`` helper
11+
functions, which were deprecated in 0.10.0.
12+
Use ``ItemizedDateDelta(years=...)``, etc. instead,
13+
or use keyword arguments directly (e.g. ``dt.add(years=1, months=2)``).
14+
- Removed the ``Date.__add__``/``__sub__`` operators with ``DateDelta``
15+
and ``Date.__sub__`` between two dates (returning ``DateDelta``),
16+
which were deprecated in 0.10.0.
17+
Use ``add()``, ``subtract()``, ``since()``, or ``until()`` instead.
18+
- Removed the ``ignore_dst`` parameter from ``OffsetDateTime`` and
19+
``PlainDateTime`` methods, which was deprecated in 0.10.0.
20+
Use ``stale_offset_ok=True`` (``OffsetDateTime``) or
21+
``naive_arithmetic_ok=True`` (``PlainDateTime``) instead.
22+
- Removed the ``py_date()``, ``py_time()``, ``py_datetime()``, and
23+
``py_timedelta()`` methods, which were deprecated in 0.10.0.
24+
Use ``to_stdlib()`` instead.
25+
- Removed the ``from_py_date()``, ``from_py_time()``,
26+
``from_py_datetime()``, and ``from_py_timedelta()`` methods,
27+
which were deprecated in 0.10.0.
28+
Use the constructor directly (e.g. ``Date(datetime.date(...))``).
29+
- Removed ``TimeDelta.in_hours()``, ``.in_minutes()``, ``.in_seconds()``,
30+
``.in_milliseconds()``, ``.in_microseconds()``, ``.in_nanoseconds()``,
31+
``.in_days_of_24h()``, and ``.in_hrs_mins_secs_nanos()``,
32+
which were deprecated in 0.10.0.
33+
Use ``total()`` or ``in_units()`` instead.
34+
- Removed ``Date.days_since()`` and ``Date.days_until()``,
35+
which were deprecated in 0.10.0.
36+
Use ``since()`` and ``until()`` with ``total='days'`` instead.
37+
- Removed ``parse_strptime()`` methods on ``OffsetDateTime`` and
38+
``PlainDateTime``, which were deprecated in 0.10.0.
39+
Use ``parse()`` instead.
40+
- Removed ``ZonedDateTime.start_of_day()``,
41+
which was deprecated in 0.10.0.
42+
Use ``start_of("day")`` instead.
43+
- Removed ``WheneverDeprecationWarning`` and ``ImplicitlyIgnoringDST``
44+
exception classes, which are no longer needed.
45+
346

447
## 0.10.1 (2026-05-??)
548

docs/guide/choosing-a-type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ an efficient and compatible choice for representing times in the past.
131131
```python
132132
>>> flight_departure = OffsetDateTime(2023, 4, 21, hour=9, offset=-4)
133133
>>> flight_arrival = OffsetDateTime(2023, 4, 21, hour=10, offset=-6)
134-
>>> (flight_arrival - flight_departure).in_hours()
134+
>>> (flight_arrival - flight_departure).total("hours")
135135
3
136136
>>> # This will emit a warning!
137137
>>> flight_arrival.add(hours=3) # a DST-bug waiting to happen!

docs/guide/parsing.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@ ZonedDateTime("2024-03-15 14:30:00+01:00[Europe/Paris]")
7878
See the {ref}`pattern format reference <pattern-format>` for the
7979
full list of specifiers and details.
8080

81-
```{deprecated} 0.10.0
82-
The ``parse_strptime()`` methods on ``OffsetDateTime`` and ``PlainDateTime``
83-
are deprecated. Use ``parse()`` with a pattern string instead, or convert
84-
from a stdlib datetime:
85-
``OffsetDateTime(datetime.strptime(...))``.
86-
```
87-
8881
## Pydantic integration
8982

9083
```{warning}

docs/guide/warnings.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ next_departure = scheduled.add(hours=1, naive_arithmetic_ok=True)
121121
The keyword argument documents the decision at the call site
122122
while keeping the suppression limited to exactly one operation.
123123

124-
```{note}
125-
These keyword arguments supersede the ``ignore_dst`` keyword argument
126-
(deprecated in 0.10).
127-
```
128-
129124
### Operators
130125

131126
The `+` and `-` operators always emit warnings when applicable, because

docs/reference/datetime.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ Several other methods are unique to one or more classes:
109109
| | | {meth}`~OffsetDateTime.assume_tz` | {meth}`~PlainDateTime.assume_tz` |
110110
| | | | {meth}`~PlainDateTime.assume_system_tz` |
111111
| | | | {meth}`~PlainDateTime.assume_fixed_offset` |
112-
| | | {meth}`~OffsetDateTime.parse_strptime` *(deprecated)* | {meth}`~PlainDateTime.parse_strptime` *(deprecated)* |
113112
| | {attr}`~ZonedDateTime.tz` | | |
114113
| | {meth}`~ZonedDateTime.now_in_system_tz` | | |
115114
| | {meth}`~ZonedDateTime.is_ambiguous` | | |
@@ -118,7 +117,6 @@ Several other methods are unique to one or more classes:
118117
| | {meth}`~ZonedDateTime.day_length` | | |
119118
| | {meth}`~ZonedDateTime.next_transition` | | |
120119
| | {meth}`~ZonedDateTime.prev_transition` | | |
121-
| | {meth}`~ZonedDateTime.start_of_day` *(deprecated)* | | |
122120

123121

124122
[^1]: `timestamp_millis()` and `timestamp_nanos()` methods are also

docs/reference/deltas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ each suited for different use cases:
4343

4444
```{note}
4545
{class}`ItemizedDelta` and {class}`ItemizedDateDelta` were introduced in version 0.10,
46-
and replace the (now deprecated) {class}`DateTimeDelta` and {class}`DateDelta` classes.
46+
replacing the removed ``DateTimeDelta`` and ``DateDelta`` classes.
4747
```
4848

4949

docs/reference/deprecated.rst

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/reference/exceptions.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ Warnings
1818
.. autoexception:: PotentialDstBugWarning
1919
:show-inheritance:
2020

21-
.. autoexception:: WheneverDeprecationWarning
22-
:show-inheritance:
23-
2421

2522
Exceptions
2623
----------

docs/reference/misc.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ This section contains API documentation for miscellaneous functions and data
1010

1111
other-types
1212
exceptions
13-
deprecated
1413

1514

1615
Context managers

docs/reference/pattern-format.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ See [](faq-leap-seconds) for details.
175175

176176
## Comparison with strftime
177177

178-
The {meth}`~OffsetDateTime.parse_strptime` methods on {class}`OffsetDateTime` and
179-
{class}`PlainDateTime` are deprecated in favor of
178+
The removed ``parse_strptime()`` methods on {class}`OffsetDateTime` and
179+
{class}`PlainDateTime` have been replaced by
180180
{meth}`~OffsetDateTime.parse`. Here's a migration guide:
181181

182182
| strftime | Pattern | Notes |

0 commit comments

Comments
 (0)