Skip to content

Commit a2c5ff8

Browse files
committed
address review
1 parent 87d0ea7 commit a2c5ff8

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

Doc/deprecations/soft-deprecations.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,3 @@ There are no plans to remove :term:`soft deprecated` APIs.
1919

2020
(Contributed by Gregory P. Smith in :gh:`86519` and
2121
Hugo van Kemenade in :gh:`148100`.)
22-
23-
* Using ``'F'`` and ``'D'`` format type codes of the :mod:`struct` module
24-
now are :term:`soft deprecated` in favor of two-letter forms ``'Zf'``
25-
and ``'Zd'``.
26-
(Contributed by Sergey B Kirpichev in :gh:`121249`.)

Doc/library/struct.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ platform-dependent.
283283

284284
.. versionchanged:: 3.15
285285
Added support for the ``'Zf'`` and ``'Zd'`` formats.
286-
``'F'`` and ``'D'`` formats are :term:`soft deprecated`.
286+
287+
.. versionchanged:: 3.16
288+
``'F'`` and ``'D'`` formats are deprecated.
287289

288290
.. seealso::
289291

Lib/test/test_struct.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,21 +1000,21 @@ def test_c_complex_round_trip(self):
10001000
with self.subTest(z=z, format=f):
10011001
round_trip = struct.unpack(f, struct.pack(f, z))[0]
10021002
self.assertComplexesAreIdentical(z, round_trip)
1003+
z = 1+1j
10031004
for f in ['F', 'D', '>F', '>D', '<F', '<D']:
1004-
z = 1+1j
1005-
with self.subTest(format=f):
1005+
with self.subTest(format=fmt):
10061006
with warnings.catch_warnings():
10071007
warnings.simplefilter("error", DeprecationWarning)
1008-
self.assertRaises(DeprecationWarning, struct.pack, f, z)
1008+
self.assertRaises(DeprecationWarning, struct.pack, fmt, z)
10091009
with warnings.catch_warnings():
10101010
with self.assertWarns(DeprecationWarning):
1011-
b = struct.pack(f, z)
1011+
b = struct.pack(fmt, z)
10121012

10131013
with warnings.catch_warnings():
10141014
warnings.simplefilter("error", DeprecationWarning)
1015-
self.assertRaises(DeprecationWarning, struct.unpack, f, b)
1015+
self.assertRaises(DeprecationWarning, struct.unpack, fmt, b)
10161016
with self.assertWarns(DeprecationWarning):
1017-
round_trip = struct.unpack(f, b)[0]
1017+
round_trip = struct.unpack(fmt, b)[0]
10181018
self.assertComplexesAreIdentical(z, round_trip)
10191019

10201020
@unittest.skipIf(

0 commit comments

Comments
 (0)