ruff/crates/red_knot_python_semantic
Connor Skees 3e702e12f7
red-knot: support narrowing for bool(E) (#14668)
Resolves https://github.com/astral-sh/ruff/issues/14547 by delegating
narrowing to `E` for `bool(E)` where `E` is some expression.

This change does not include other builtin class constructors which
should also work in this position, like `int(..)` or `float(..)`, as the
original issue does not mention these. It should be easy enough to add
checks for these as well if we want to.

I don't see a lot of markdown tests for malformed input, maybe there's a
better place for the no args and too many args cases to go?

I did see after the fact that it looks like this task was intended for a
new hire.. my apologies. I got here from
https://github.com/astral-sh/ruff/issues/13694, which is marked
help-wanted.

---------

Co-authored-by: David Peter <mail@david-peter.de>
2024-12-03 03:04:59 +00:00
..
resources red-knot: support narrowing for bool(E) (#14668) 2024-12-03 03:04:59 +00:00
src red-knot: support narrowing for bool(E) (#14668) 2024-12-03 03:04:59 +00:00
tests mdtest: include test name in printed rerun command (#14684) 2024-11-30 11:01:06 +00:00
build.rs Modernize build scripts (#13837) 2024-10-20 22:35:35 +01:00
Cargo.toml Workspace discovery (#14308) 2024-11-15 19:20:15 +01:00