Update docs/ql-design-patterns.md

Co-authored-by: Rasmus Wriedt Larsen <rasmuswl@github.com>
This commit is contained in:
Pavel Avgustinov
2020-11-10 15:59:45 +00:00
committed by GitHub
parent 14236709f6
commit 60ea9cec6e

View File

@@ -60,7 +60,7 @@ The key element of the pattern is to provide a field of type `MySpecialExpr::Ran
</details>
Note, previously we used to write `MySpecialExpr() { this = self }`, but we now recommend using `MySpecialExpr() { this = range }` instead to avoid anyone mistakenly thinking that `self` and `this` are synonyms in general.
Note that in some libraries, the `range` field is in fact called `self`. While we do recommend using `range` for consistency, the name of the field does not matter (and using `range` avoids confusion in contexts like Python analysis that has strong usage of `self`).
### Rationale