From: Sebastián Ramírez Date: Mon, 5 Dec 2022 20:06:20 +0000 (+0100) Subject: 📝 Add note clarifying that parameters should allow static evaluation as suggested... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ca7f25af4184868c1b336a517141b8c261aec0b;p=thirdparty%2Ffastapi%2Ffastapi.git 📝 Add note clarifying that parameters should allow static evaluation as suggested by @pawamoy --- diff --git a/typing_doc.md b/typing_doc.md index 0dbff4ab0f..b45f7d6cd1 100644 --- a/typing_doc.md +++ b/typing_doc.md @@ -51,6 +51,8 @@ Other possible future parameters could include: * `blocks: bool`: this would mark a callable as a synchronous blocking call. This way, editors could use it to warn about using it in async contexts directly. * `example: Any`: an example value for a parameter, or an example of the usage of the class, function, or method. +This specification targets static analysis tools and editors, and as such, the values passed to these parameters should allow static evaluation and analysis. If a developer passes as the value to one of this parameters something that requires runtime execution (e.g. a function call) the behavior of static analysis tools is unspecified and they could omit that parameter from their process and results. For static analysis tools to be conformant with this specification they need only to support statically accessible values. + An example documenting the attributes of a class, or in this case, the keys of a `TypedDict` could look like this: ```python