Skip to content

fail to find NameError in for loop expression_list #498

Closed
@pylint-bot

Description

@pylint-bot

Originally reported by: BitBucket: hacman, GitHub: @hacman?


the following code is not caught by pylint. obviously, x will be a NameError at runtime.

for x in x:
pass

if the loop variable is different, then pylint properly catches a name error. e.g., the following is caught by pylint (undefined-variable as expected):

for i in L:
pass

I hope this report was helpful. Thanks for pylint! It makes my life so much easier.


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions