Skip to content

Conversation

@ansley
Copy link

@ansley ansley commented Mar 8, 2023

Stack from ghstack (oldest at bottom):

This lint rule is probably in Flake8 to prevent elements from leaking
out of the comprehension scope, but the behavior was fixed in Python3.
I worry such a strict lint rule will cause more problems than it solves,
considering we use Python 3.10 at Meta. Perhaps we should consider
disabling this rule by default.

This lint rule is probably in Flake8 to prevent elements from leaking
out of the comprehension scope, but the behavior was fixed in Python3.
I worry such a strict lint rule will cause more problems than it solves,
considering we use Python 3.10 at Meta. Perhaps we should consider
disabling this rule by default.

[ghstack-poisoned]
This lint rule is probably in Flake8 to prevent elements from leaking
out of the comprehension scope, but the behavior was fixed in Python3.
I worry such a strict lint rule will cause more problems than it solves,
considering we use Python 3.10 at Meta. Perhaps we should consider
disabling this rule by default.

[ghstack-poisoned]
Copy link
Collaborator

@amyreese amyreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some test cases covering mutually exclusive scopes, where I would expect this to be allowed?

Something like:

def foo():
    i = 1
    print(i)

def bar():
    values = [i * 2 for i in range(5)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. lint rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants