From 1ca7f25af4184868c1b336a517141b8c261aec0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 5 Dec 2022 21:06:20 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20note=20clarifying=20that?= =?UTF-8?q?=20parameters=20should=20allow=20static=20evaluation=20as=20sug?= =?UTF-8?q?gested=20by=20@pawamoy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typing_doc.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/typing_doc.md b/typing_doc.md index 0dbff4ab0..b45f7d6cd 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