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:
John Stilley 2025-03-23 10:55:14 -07:00 committed by GitHub
parent 902d86e79e
commit 3899f7156f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 10 additions and 10 deletions

View file

@ -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.
#

View file

@ -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`:

View file

@ -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

View file

@ -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

View file

@ -153,7 +153,7 @@ class MIMEPart(Message[_HeaderRegistryT, _HeaderRegistryParamT]):
def attach(self, payload: Self) -> None: ... # type: ignore[override]
# The attachments are created via type(self) in the attach method. It's theoretically
# possible to sneak other attachment types into a MIMEPart instance, but could cause
# cause unforseen consequences.
# cause unforeseen consequences.
def iter_attachments(self) -> Iterator[Self]: ...
def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT]]: ...
def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ...

View file

@ -197,7 +197,7 @@ def test_index_with_attribute():
ds["Foo"] = ds.Foo + 2.0
assert (
ds["Foo"] is ds.Foo
) # This is now modfied, but both methods points to the same object
) # This is now modified, but both methods points to the same object
def test_getitem_time(ds3):

View file

@ -894,7 +894,7 @@ struct PrinterState<'a> {
line_suffixes: LineSuffixes<'a>,
verbatim_markers: Vec<TextRange>,
group_modes: GroupModes,
// Re-used queue to measure if a group fits. Optimisation to avoid re-allocating a new
// Reused queue to measure if a group fits. Optimisation to avoid re-allocating a new
// vec every time a group gets measured
fits_stack: Vec<StackFrame>,
fits_queue: Vec<std::slice::Iter<'a, FormatElement>>,

View file

@ -3124,7 +3124,7 @@ lambda: fu
#[test]
fn redefined_by_gen_exp() {
// Re-using a global name as the loop variable for a generator
// Reusing a global name as the loop variable for a generator
// expression results in a redefinition warning.
flakes(
"import fu; (1 for fu in range(1))",