You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions can have side-effects (print is a good example), so the loop-invariant scanner may give some false-positives.
155
155
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.
157
157
158
158
```python
159
159
from os.path import exists
@@ -170,9 +170,9 @@ def direct_import():
170
170
171
171
`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.
172
172
173
-
### W8202: Global name usage in a loop (`loop-invariant-global-usage`)
173
+
### W8202: Global name usage in a loop (`loop-global-usage`)
174
174
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.:
0 commit comments