Skip to content

[red-knot] Narrowing - Not operator #13942

Merged
carljm merged 2 commits intoastral-sh:mainfrom
TomerBin:tomer/narrow-not-expression
Oct 28, 2024
Merged

[red-knot] Narrowing - Not operator #13942
carljm merged 2 commits intoastral-sh:mainfrom
TomerBin:tomer/narrow-not-expression

Conversation

@TomerBin
Copy link
Contributor

Summary

After #13918 has landed, narrowing constraint negation became easy, so adding support for not operator.

Test Plan

I added a new mdtest file for not expression, but maybe we should spread it over the other test files (by adding not cases to each one of them)? I'll be happy to hear your preference around that :)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@TomerBin TomerBin marked this pull request as ready for review October 27, 2024 21:30
@MichaReiser MichaReiser added the ty Multi-file analysis & type inference label Oct 28, 2024
Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

This is awesome, thank you!!

@carljm
Copy link
Contributor

carljm commented Oct 28, 2024

I added a new mdtest file for not expression, but maybe we should spread it over the other test files (by adding not cases to each one of them)? I'll be happy to hear your preference around that :)

I like what you've done here. I think in general any feature that makes sense to make a PR to add, probably makes sense to have a dedicated file to test as well. Which of course isn't incompatible with perhaps also having it occasionally show up in tests of other features, too, but not in a "must add it everywhere" way.

@carljm carljm enabled auto-merge (squash) October 28, 2024 20:25
@carljm carljm merged commit 74cf66e into astral-sh:main Oct 28, 2024
@TomerBin TomerBin deleted the tomer/narrow-not-expression branch October 28, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants