KEMBAR78
Fix crash caused by deferred lambdas by not deferring lambdas by JukkaL · Pull Request #4232 · python/mypy · GitHub
Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Nov 9, 2017

The inferred type of lambda may affect the surrounding scope, and
lambdas inherit the binder from the surrounding scope. These things
make it a bad idea to defer lambdas.

Fixes #3672.

The inferred type of lambda may affect the surrounding scope, and
lambdas inherit the binder from the surrounding scope. These things
make it a bad idea to defer lambdas.

Fixes #3672.
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

LGTM assuming testpr is OK with it.

from mypy.visitor import ExpressionVisitor
from mypy.plugin import Plugin, MethodContext, MethodSigContext, FunctionContext
from mypy.typeanal import make_optional_type
from mypy.binder import ConditionalTypeBinder
Copy link
Member

Choose a reason for hiding this comment

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

Stray import?

@gvanrossum gvanrossum merged commit 45ca578 into master Nov 9, 2017
@gvanrossum gvanrossum deleted the lambda-crash branch November 9, 2017 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants