]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-100633 Tutorial: Fix dataclasses import (GH-100638)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 31 Dec 2022 12:28:59 +0000 (04:28 -0800)
committerGitHub <noreply@github.com>
Sat, 31 Dec 2022 12:28:59 +0000 (04:28 -0800)
import dataclass not dataclasses from dataclasses
(cherry picked from commit 98308dbeb110198ebe28bdb7720d3671b3e7f57b)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
Doc/tutorial/classes.rst

index 5abb767cb0a8a8a7858bf3d2994d23240dd44b8d..30450c70f3e8e9f669e51357160b71bc02045efd 100644 (file)
@@ -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: