Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
534939e
gh-145633: deprecate float.__getformat__() class method
skirpichev Mar 25, 2026
aaf2b0a
workaround for missing ctypes
skirpichev Mar 25, 2026
907bfb1
+ use struct
skirpichev Mar 25, 2026
a8cbdbf
+news
skirpichev Mar 25, 2026
e38e308
Merge branch 'master' into deprecate-__getformat__/145633
skirpichev Apr 1, 2026
3a4c818
address review: restore test_getformat()
skirpichev Apr 1, 2026
b93f48c
address review: test_funcattrs.py
skirpichev Apr 1, 2026
04356f7
address review: document _have_ieee_doubles + a quick exit
skirpichev Apr 1, 2026
68a3264
address review: adjust news
skirpichev Apr 1, 2026
9fe8a22
+typo
skirpichev Apr 1, 2026
27d31f2
Merge branch 'master' into deprecate-__getformat__/145633
skirpichev Apr 17, 2026
291401b
address review: use assertWarns(DeprecationWarning)
skirpichev Apr 17, 2026
67fc46e
Apply suggestion from @skirpichev
skirpichev Apr 17, 2026
e4d5f18
+1
skirpichev Apr 17, 2026
3a0136e
Merge branch 'master' into deprecate-__getformat__/145633
skirpichev May 22, 2026
ec18531
Merge branch 'main' into deprecate-__getformat__/145633
skirpichev Jul 31, 2026
6dec973
Merge branch 'main' into deprecate-__getformat__/145633
skirpichev Aug 1, 2026
d330317
Merge branch 'main' into deprecate-__getformat__/145633
skirpichev Aug 3, 2026
40f9873
XXX partial reversion of 1cbe460eb6c
skirpichev Aug 3, 2026
a7f9a1a
Revert "XXX partial reversion of 1cbe460eb6c"
skirpichev Aug 3, 2026
1389d58
XXX
skirpichev Aug 3, 2026
2c55ab2
Merge branch 'main' into deprecate-__getformat__/145633
skirpichev Aug 4, 2026
290ec9e
Merge branch 'master' into deprecate-__getformat__/145633
skirpichev Aug 31, 2026
212b8ab
Merge branch 'main' into deprecate-__getformat__/145633
skirpichev Sep 16, 2026
9875045
+1
skirpichev Sep 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into deprecate-__getformat__/145633
  • Loading branch information
skirpichev authored Jul 31, 2026
commit ec1853118fc2af0570665456a787a10dfa7dd4ea
21 changes: 16 additions & 5 deletions Doc/deprecations/pending-removal-in-3.21.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Pending removal in Python 3.21
------------------------------

* The ``__getformat__()`` class method of the :class:`float` is deprecated and
will be removed in Python 3.21. On CPython, ``float.__getformat__()`` always
return a string, prefixed with ``"IEEE"``: to build CPython, you need support
for IEEE 754 floating-point numbers since Python 3.11. (Contributed by
Sergey B Kirpichev in :gh:`85989`.)

* :mod:`abc`

* Soft-deprecated since Python 3.3 :class:`abc.abstractclassmethod`,
Expand All @@ -18,8 +24,13 @@ Pending removal in Python 3.21
* The ``dims`` property of ``ast.Tuple`` will be removed in Python 3.21. Use
the ``ast.Tuple.elts`` property instead.

* The ``__getformat__()`` class method of the :class:`float` is deprecated and
will be removed in Python 3.21. On CPython, ``float.__getformat__()`` always
return a string, prefixed with ``"IEEE"``: to build CPython, you need support
for IEEE 754 floating-point numbers since Python 3.11. (Contributed by
Sergey B Kirpichev in :gh:`85989`.)
* :mod:`struct`:

* Soft-deprecated since Python 3.15, using ``'F'`` and ``'D'`` type codes are now
deprecated. These codes will be removed in Python 3.21. Use instead
two-letter forms ``'Zf'`` and ``'Zd'``.

* :mod:`tempfile`:

* ``tempfile._TemporaryFileWrapper`` will be removed in Python 3.21. Use the
public :class:`tempfile.TemporaryFileWrapper` instead.
33 changes: 28 additions & 5 deletions Doc/whatsnew/3.16.rst
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,12 @@ Deprecated
New deprecations
----------------

* The ``__getformat__()`` class method of the :class:`float` is deprecated
and will be removed in Python 3.21. On CPython, ``float.__getformat__()``
always return a string, prefixed with ``"IEEE"``: to build CPython, you
need support for IEEE 754 floating-point numbers since Python 3.11.
(Contributed by Sergey B Kirpichev in :gh:`85989`.)

* :mod:`abc`

* Soft-deprecated since Python 3.3 :class:`abc.abstractclassmethod`,
Expand All @@ -741,11 +747,28 @@ New deprecations
3.9, now issues a deprecation warning on use. This property is slated for
removal in 3.21. Use ``ast.Tuple.elts`` instead.

* The ``__getformat__()`` class method of the :class:`float` is deprecated
and will be removed in Python 3.21. On CPython, ``float.__getformat__()``
always return a string, prefixed with ``"IEEE"``: to build CPython, you
need support for IEEE 754 floating-point numbers since Python 3.11.
(Contributed by Sergey B Kirpichev in :gh:`85989`.)
* :mod:`struct`:

* Soft-deprecated since Python 3.15, using ``'F'`` and ``'D'`` type codes are now
deprecated. These codes will be removed in Python 3.21. Use instead
two-letter forms ``'Zf'`` and ``'Zd'``.
(Contributed by Sergey B Kirpichev in :gh:`121249`.)

* :mod:`tempfile`

* The private ``tempfile._TemporaryFileWrapper`` name is deprecated
and is slated for removal in Python 3.21.
Use the new public :class:`tempfile.TemporaryFileWrapper` instead,
which is the return type of :func:`tempfile.NamedTemporaryFile`.

* :mod:`tkinter`:

* :func:`tkinter.filedialog.askopenfiles` is deprecated and slated for
removal in Python 3.19. Opening several files at once is error-prone, and
the returned list cannot be used in a :keyword:`with` statement. Iterate
over the names returned by :func:`~tkinter.filedialog.askopenfilenames` and
open them one by one instead.
(Contributed by Serhiy Storchaka in :gh:`152638`.)

.. Add deprecations above alphabetically, not here at the end.

Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.