mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-19 03:48:29 +00:00
[ty] Use "cannot" consistently over "can not" (#21255)
This commit is contained in:
parent
e8c35b9704
commit
39f105bc4a
24 changed files with 39 additions and 39 deletions
|
|
@ -194,7 +194,7 @@ class_with_descriptor_dunder = ClassWithDescriptorDunder()
|
|||
reveal_type(class_with_descriptor_dunder[0]) # revealed: str
|
||||
```
|
||||
|
||||
## Dunders can not be overwritten on instances
|
||||
## Dunders cannot be overwritten on instances
|
||||
|
||||
If we attempt to overwrite a dunder method on an instance, it does not affect the behavior of
|
||||
implicit dunder calls:
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class E(metaclass=Meta): ...
|
|||
reveal_type(inspect.getattr_static(E, "attr")) # revealed: int
|
||||
```
|
||||
|
||||
Metaclass attributes can not be added when probing an instance of the class:
|
||||
Metaclass attributes cannot be added when probing an instance of the class:
|
||||
|
||||
```py
|
||||
reveal_type(inspect.getattr_static(E(), "attr", "non_existent")) # revealed: Literal["non_existent"]
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ reveal_type(C.f) # revealed: bound method <class 'C'>.f(arg: int) -> str
|
|||
reveal_type(C.f(1)) # revealed: str
|
||||
```
|
||||
|
||||
The method `f` can not be accessed from an instance of the class:
|
||||
The method `f` cannot be accessed from an instance of the class:
|
||||
|
||||
```py
|
||||
# error: [unresolved-attribute] "Object of type `C` has no attribute `f`"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue