From 3dfbbc5057afe24546462d2849657720eb12b412 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Fri, 28 Oct 2022 23:02:23 +0200 Subject: [PATCH] Doc: Clarify annotations in style guide (#1149) * Doc: Clarify annotations in style guide * Fix typo * Update docs/style.md Co-authored-by: Doug Hoskisson Co-authored-by: Doug Hoskisson --- docs/style.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/style.md b/docs/style.md index a9f55caa..745b51ed 100644 --- a/docs/style.md +++ b/docs/style.md @@ -15,7 +15,9 @@ * Strings in worlds should use double quotes as well, but imported code may differ. * Prefer [format string literals](https://peps.python.org/pep-0498/) over string concatenation, use single quotes inside them: `f"Like {dct['key']}"` -* Use type annotation where possible. +* Use type annotations where possible for function signatures and class members. +* Use type annotations where appropriate for local variables (e.g. `var: List[int] = []`, or when the + type is hard or impossible to deduce.) Clear annotations help developers look up and validate API calls. ## Markdown