From: Sebastián Ramírez Date: Mon, 28 Aug 2023 14:10:18 +0000 (+0200) Subject: 📝 Update DocInfo to not be a dataclass, Jelle's feedback, avoid bootstrapping problem... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3360367f71f96bf738f33e97482e44386eb35ba;p=thirdparty%2Ffastapi%2Ffastapi.git 📝 Update DocInfo to not be a dataclass, Jelle's feedback, avoid bootstrapping problems, make it hashable --- diff --git a/typing_doc.md b/typing_doc.md index c502f7b6ee..b699b481e8 100644 --- a/typing_doc.md +++ b/typing_doc.md @@ -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()`.