https://github.com/python/cpython/commit/f7ad4ffa563fbe14d6b0020c45720bebde73de62 commit: f7ad4ffa563fbe14d6b0020c45720bebde73de62 branch: 3.10 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2022年12月31日T04:28:36-08:00 summary: gh-100633 Tutorial: Fix dataclasses import (GH-100638) import dataclass not dataclasses from dataclasses (cherry picked from commit 98308dbeb110198ebe28bdb7720d3671b3e7f57b) Co-authored-by: Owain Davies <116417456+OTheDev at users.noreply.github.com> files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 5abb767cb0a8..30450c70f3e8 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -740,7 +740,7 @@ Sometimes it is useful to have a data type similar to the Pascal "record" or C "struct", bundling together a few named data items. The idiomatic approach is to use :mod:`dataclasses` for this purpose:: - from dataclasses import dataclasses + from dataclasses import dataclass @dataclass class Employee: