[ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492)

Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
This commit is contained in:
Renkai Ge 2025-09-23 22:26:55 +08:00 committed by GitHub
parent 4ed8c65d29
commit bf38e69870
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 213 additions and 194 deletions

View file

@ -69,7 +69,7 @@ instance = C()
instance.non_existent = 1 # error: [unresolved-attribute]
```
## Possibly-unbound attributes
## Possibly-missing attributes
When trying to set an attribute that is not defined in all branches, we emit errors:
@ -79,10 +79,10 @@ def _(flag: bool) -> None:
if flag:
attr: int = 0
C.attr = 1 # error: [possibly-unbound-attribute]
C.attr = 1 # error: [possibly-missing-attribute]
instance = C()
instance.attr = 1 # error: [possibly-unbound-attribute]
instance.attr = 1 # error: [possibly-missing-attribute]
```
## Data descriptors

View file

@ -23,7 +23,7 @@ async def main() -> None:
await MissingAwait() # error: [invalid-await]
```
## Custom type with possibly unbound `__await__`
## Custom type with possibly missing `__await__`
This diagnostic also points to the method definition if available.

View file

@ -116,7 +116,7 @@ def _(n: int):
# error: [invalid-argument-type] "Argument to function `f5` is incorrect: Expected `str`, found `Literal[3]`"
# error: [no-matching-overload] "No overload of function `f6` matches arguments"
# error: [call-non-callable] "Object of type `Literal[5]` is not callable"
# error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possibly unbound `__call__` method)"
# error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possibly missing `__call__` method)"
x = f(3)
```