summaryrefslogtreecommitdiff
path: root/pylint/test/functional/undefined_loop_variable.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/test/functional/undefined_loop_variable.py')
-rw-r--r--pylint/test/functional/undefined_loop_variable.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/pylint/test/functional/undefined_loop_variable.py b/pylint/test/functional/undefined_loop_variable.py
index 3840003b5..a984898f8 100644
--- a/pylint/test/functional/undefined_loop_variable.py
+++ b/pylint/test/functional/undefined_loop_variable.py
@@ -1,4 +1,4 @@
-# pylint: disable=missing-docstring
+# pylint: disable=missing-docstring,redefined-builtin
def do_stuff(some_random_list):
for var in some_random_list:
@@ -59,3 +59,17 @@ def do_stuff_with_a_tuple():
for var in (1, 2, 3):
pass
return var
+
+
+def do_stuff_with_a_range():
+ for var in range(1, 2):
+ pass
+ return var
+
+
+def do_stuff_with_redefined_range():
+ def range(key):
+ yield from [1, key]
+ for var in range(3):
+ pass
+ return var # [undefined-loop-variable]