]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-100633 Tutorial: Fix dataclasses import (#100638)
authorOwain Davies <116417456+OTheDev@users.noreply.github.com>
Sat, 31 Dec 2022 10:23:18 +0000 (17:23 +0700)
committerGitHub <noreply@github.com>
Sat, 31 Dec 2022 10:23:18 +0000 (10:23 +0000)
import dataclass not dataclasses from dataclasses

Doc/tutorial/classes.rst

index a206ba371976090bf510372412af4ad2f5c23201..116801177a3addc11d757e900d1b33d9b0811116 100644 (file)
@@ -741,7 +741,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: