mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 14:52:01 +00:00
Fixing more spelling errors (#16926)
## Summary Here I fix the last English spelling errors I could find in the repo. Again, I am trying not to touch variable/function names, or anything that might be misspelled in the API. The goal is to make this PR safe and easy to merge. ## Test Plan I have run all the unit tests. Though, again, all of the changes I make here are to docs and docstrings. I make no code changes, which I believe should greatly mitigate the testing concerns.
This commit is contained in:
parent
902d86e79e
commit
3899f7156f
8 changed files with 10 additions and 10 deletions
|
@ -697,10 +697,10 @@ class Base:
|
|||
self.defined_in_init: str | None = "value in base"
|
||||
|
||||
class Intermediate(Base):
|
||||
# Re-declaring base class attributes with the *same *type is fine:
|
||||
# Redeclaring base class attributes with the *same *type is fine:
|
||||
base_class_attribute_1: str | None = None
|
||||
|
||||
# Re-declaring them with a *narrower type* is unsound, because modifications
|
||||
# Redeclaring them with a *narrower type* is unsound, because modifications
|
||||
# through a `Base` reference could violate that constraint.
|
||||
#
|
||||
# Mypy does not report an error here, but pyright does: "… overrides symbol
|
||||
|
@ -712,7 +712,7 @@ class Intermediate(Base):
|
|||
# TODO: This should be an error
|
||||
base_class_attribute_2: str
|
||||
|
||||
# Re-declaring attributes with a *wider type* directly violates LSP.
|
||||
# Redeclaring attributes with a *wider type* directly violates LSP.
|
||||
#
|
||||
# In this case, both mypy and pyright report an error.
|
||||
#
|
||||
|
|
|
@ -222,7 +222,7 @@ reveal_type(X) # revealed: Unknown
|
|||
### Only explicit re-exports are considered re-exported from `.pyi` files
|
||||
|
||||
For `.pyi` files, we should consider all imports private to the stub unless they are included in
|
||||
`__all__` or use the explict `from foo import X as X` syntax.
|
||||
`__all__` or use the explicit `from foo import X as X` syntax.
|
||||
|
||||
`a.pyi`:
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Eager scopes
|
||||
|
||||
Some scopes are executed eagerly: references to variables defined in enclosing scopes are resolved
|
||||
_immediately_. This is in constrast to (for instance) function scopes, where those references are
|
||||
_immediately_. This is in contrast to (for instance) function scopes, where those references are
|
||||
resolved when the function is called.
|
||||
|
||||
## Function definitions
|
||||
|
|
|
@ -17,7 +17,7 @@ reveal_type(Bar) # revealed: Literal[Bar]
|
|||
reveal_type(Bar.__mro__) # revealed: tuple[Literal[Bar], Literal[Foo], Literal[object]]
|
||||
```
|
||||
|
||||
## Access to attributes declarated in stubs
|
||||
## Access to attributes declared in stubs
|
||||
|
||||
Unlike regular Python modules, stub files often omit the right-hand side in declarations, including
|
||||
in class scope. However, from the perspective of the type checker, we have to treat them as bindings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue