Skip to content

Commit 9310481

Browse files
committed
Merge branch 'constant_expressions' into main
2 parents 16c66c6 + c895b29 commit 9310481

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def loop_invariant_statement():
106106
print(n * i) # [loop-invariant-statement]
107107
```
108108

109-
The loop-invariance checker will underline expressions and subexpressions within the body using the same rules:
109+
The loop-invariance checker will underline expressions and sub-expressions within the body using the same rules:
110110

111111
```python
112112
def loop_invariant_statement_more_complex():
@@ -153,7 +153,7 @@ def loop_invariant_branching():
153153

154154
Functions can have side-effects (print is a good example), so the loop-invariant scanner may give some false-positives.
155155

156-
It will also highlight dotted expresions, e.g. attribute lookups. This may seem noisy, but in some cases this is valid, e.g.
156+
It will also highlight dotted expressions, e.g. attribute lookups. This may seem noisy, but in some cases this is valid, e.g.
157157

158158
```python
159159
from os.path import exists
@@ -170,9 +170,9 @@ def direct_import():
170170

171171
`direct_import()` is 10-15% faster than `dotted_import()` because it doesn't need to load the `os` global, the `path` attribute and the `exists` method for each iteration.
172172

173-
### W8202: Global name usage in a loop (`loop-invariant-global-usage`)
173+
### W8202: Global name usage in a loop (`loop-global-usage`)
174174

175-
Loading globals is slower than loading "fast" local variables. The difference is marginal, but when propagated in a loop, there can be a noticable speed improvement, e.g.:
175+
Loading globals is slower than loading "fast" local variables. The difference is marginal, but when propagated in a loop, there can be a noticeable speed improvement, e.g.:
176176

177177
```python
178178
d = {

0 commit comments

Comments
 (0)