Skip to content

Forbid to shadow outer scope variables with blocks #399

@sobolevn

Description

@sobolevn

Rule request

Thesis

This example can damage your code: https://github.com/satwikkansal/wtfPython#-the-disappearing-variable-from-outer-scope

e = 7
try:
    raise Exception()
except Exception as e:
    pass

>>> print(e)
NameError: name 'e' is not defined

Reasoning

It just deletes your variables! This should not happen.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions