]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Update DocInfo to not be a dataclass, Jelle's feedback, avoid bootstrapping problem...
authorSebastián Ramírez <tiangolo@gmail.com>
Mon, 28 Aug 2023 14:10:18 +0000 (16:10 +0200)
committerSebastián Ramírez <tiangolo@gmail.com>
Mon, 28 Aug 2023 14:10:18 +0000 (16:10 +0200)
typing_doc.md

index c502f7b6eeb4a617ac515c5c1f33cbefd46120d5..b699b481e84bd62a2711a62892625e685966a2eb 100644 (file)
@@ -89,12 +89,9 @@ def create_user(
 The return of the `doc()` function is an instance of a class that can be checked and used at runtime, defined as:
 
 ```Python
-from dataclasses import dataclass
-
-
-@dataclass
 class DocInfo:
-    documentation: str
+    def __init__(self, documentation: str):
+        self.documentation = documentation
 ```
 
 where the attribute `documentation` contains the same value string passed to the function `doc()`.