[ty] Use "cannot" consistently over "can not" (#21255)

This commit is contained in:
Alex Waygood 2025-11-03 10:38:20 -05:00 committed by GitHub
parent e8c35b9704
commit 39f105bc4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 39 additions and 39 deletions

View file

@ -1878,7 +1878,7 @@ date.day = 8
date.month = 4
date.year = 2025
# error: [unresolved-attribute] "Can not assign object of type `Literal["UTC"]` to attribute `tz` on type `Date` with custom `__setattr__` method."
# error: [unresolved-attribute] "Cannot assign object of type `Literal["UTC"]` to attribute `tz` on type `Date` with custom `__setattr__` method."
date.tz = "UTC"
```
@ -1894,10 +1894,10 @@ class Frozen:
existing: int = 1
def __setattr__(self, name, value) -> Never:
raise AttributeError("Attributes can not be modified")
raise AttributeError("Attributes cannot be modified")
instance = Frozen()
instance.non_existing = 2 # error: [invalid-assignment] "Can not assign to unresolved attribute `non_existing` on type `Frozen`"
instance.non_existing = 2 # error: [invalid-assignment] "Cannot assign to unresolved attribute `non_existing` on type `Frozen`"
instance.existing = 2 # error: [invalid-assignment] "Cannot assign to attribute `existing` on type `Frozen` whose `__setattr__` method returns `Never`/`NoReturn`"
```
@ -1949,7 +1949,7 @@ def flag() -> bool:
class Frozen:
if flag():
def __setattr__(self, name, value) -> Never:
raise AttributeError("Attributes can not be modified")
raise AttributeError("Attributes cannot be modified")
instance = Frozen()
instance.non_existing = 2 # error: [invalid-assignment]