summaryrefslogtreecommitdiff
path: root/tests/functional/u/undefined/undefined_loop_variable_py311.py
blob: 93b43a5468cabfc4bdb36cb64c0927ca66deaf33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""Tests for undefined-loop-variable using Python 3.11 syntax."""

from typing import Never


def for_else_never(iterable):
    """Test for-else with Never type."""

    def idontreturn() -> Never:
        """This function never returns."""

    while True:
        for thing in iterable:
            break
        else:
            idontreturn()
        print(thing)