summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2018-09-11 04:37:33 (GMT)
committerGregory P. Smith <greg@krypto.org>2018-09-11 04:37:33 (GMT)
commit3666b3c1f695a145adab1bf644c22e564e8eb0ee (patch)
tree1d0dcca583e39e2024906a0a9b8d395b31d7f423 /Doc
parent5033aa77aacaa5505636f150e8d54baac5bdca9c (diff)
downloadcpython-3666b3c1f695a145adab1bf644c22e564e8eb0ee.zip
cpython-3666b3c1f695a145adab1bf644c22e564e8eb0ee.tar.gz
cpython-3666b3c1f695a145adab1bf644c22e564e8eb0ee.tar.bz2
bpo-33032: Mention the implicit cache in struct.Struct() docs (GH-7700)
Mention the implicit cache in struct.Struct() docs. Consistent with the re.compile documentation note.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/struct.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst
index d6a3cb7..bad33ac 100644
--- a/Doc/library/struct.rst
+++ b/Doc/library/struct.rst
@@ -405,6 +405,12 @@ The :mod:`struct` module also defines the following type:
methods is more efficient than calling the :mod:`struct` functions with the
same format since the format string only needs to be compiled once.
+ .. note::
+
+ The compiled versions of the most recent format strings passed to
+ :class:`Struct` and the module-level functions are cached, so programs
+ that use only a few format strings needn't worry about reusing a single
+ :class:`Struct` instance.
Compiled Struct objects support the following methods and attributes: