summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authordenballakh <47365157+denballakh@users.noreply.github.com>2023-08-26 09:54:16 (GMT)
committerGitHub <noreply@github.com>2023-08-26 09:54:16 (GMT)
commite407cea1938b80b1d469f148a4ea65587820e3eb (patch)
tree21b9df69dbdb5ffff761f94107c10a8f59ea6768 /Doc
parent8ba47146111d714c7b61825d43b52311d9be366d (diff)
downloadcpython-e407cea1938b80b1d469f148a4ea65587820e3eb.zip
cpython-e407cea1938b80b1d469f148a4ea65587820e3eb.tar.gz
cpython-e407cea1938b80b1d469f148a4ea65587820e3eb.tar.bz2
gh-107406: Add better `struct.Struct` repr (#107407)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/struct.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst
index c94dfde..e2e6fc5 100644
--- a/Doc/library/struct.rst
+++ b/Doc/library/struct.rst
@@ -1,6 +1,10 @@
:mod:`struct` --- Interpret bytes as packed binary data
=======================================================
+.. testsetup:: *
+
+ from struct import *
+
.. module:: struct
:synopsis: Interpret bytes as packed binary data.
@@ -597,6 +601,11 @@ The :mod:`struct` module also defines the following type:
The calculated size of the struct (and hence of the bytes object produced
by the :meth:`pack` method) corresponding to :attr:`format`.
+ .. versionchanged:: 3.13 The *repr()* of structs has changed. It
+ is now:
+
+ >>> Struct('i')
+ Struct('i')
.. _half precision format: https://en.wikipedia.org/wiki/Half-precision_floating-point_format