[red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674)

## Summary

Use `Unknown | T_inferred` as the type for *undeclared* public symbols.

## Test Plan

- Updated existing tests
- New test for external `__slots__` modifications.
- New tests for external modifications of public symbols.
This commit is contained in:
David Peter
2025-01-24 12:47:48 +01:00
committed by GitHub
parent 7778d1d646
commit 1feb3cf41a
23 changed files with 212 additions and 91 deletions

View File

@@ -55,7 +55,7 @@ reveal_type("x" or "y" and "") # revealed: Literal["x"]
## Evaluates to builtin
```py path=a.py
redefined_builtin_bool = bool
redefined_builtin_bool: type[bool] = bool
def my_bool(x) -> bool:
return True