Skip to content

impl code action for narrowing the value with an is not None #4169#4244

Open
asukaminato0721 wants to merge 2 commits into
facebook:mainfrom
asukaminato0721:4169
Open

impl code action for narrowing the value with an is not None #4169#4244
asukaminato0721 wants to merge 2 commits into
facebook:mainfrom
asukaminato0721:4169

Conversation

@asukaminato0721

Copy link
Copy Markdown
Collaborator

Summary

Fixes #4169

Adds an Add assert x is not None quick fix for optional simple-name values, inserts the assertion with correct indentation before the containing statement.

Avoids unsafe edits for inline statements or complex expressions.

Test Plan

add test

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

code action for narrowing the value with an is not None

2 participants