ruff/crates/red_knot_python_semantic
TomerBin ec72e675d9
Red Knot - Infer the return value of bool() (#13538)
## Summary
Following #13449, this PR adds custom handling for the bool constructor,
so when the input type has statically known truthiness value, it will be
used as the return value of the bool function.
For example, in the following snippet x will now be resolved to
`Literal[True]` instead of `bool`.
```python
x = bool(1)
```

## Test Plan
Some cargo tests were added.
2024-09-27 12:11:55 -07:00
..
src Red Knot - Infer the return value of bool() (#13538) 2024-09-27 12:11:55 -07:00
Cargo.toml Use an empty vendored file system in Ruff (#13436) 2024-09-21 16:31:42 +00:00
README.md [red-knot] Merge the semantic and module-resolver crates (#12751) 2024-08-08 15:34:11 +01:00

Red Knot

Semantic analysis for the red-knot project.

Vendored types for the stdlib

This crate vendors typeshed's stubs for the standard library. The vendored stubs can be found in crates/red_knot_python_semantic/vendor/typeshed. The file crates/red_knot_python_semantic/vendor/typeshed/source_commit.txt tells you the typeshed commit that our vendored stdlib stubs currently correspond to.

The typeshed stubs are updated every two weeks via an automated PR using the sync_typeshed.yaml workflow in the .github/workflows directory. This workflow can also be triggered at any time via workflow dispatch.