Fix typos in docs and comments (#11064)

This commit is contained in:
Alex Waygood
2023-11-23 14:55:58 +00:00
committed by GitHub
parent 30f7267b5d
commit 01432805d9
12 changed files with 16 additions and 16 deletions

View File

@@ -181,7 +181,7 @@ supported:
generated by typeshed or required by the upstream package are allowed to
be listed here, for security reasons. See
[this issue](https://github.com/typeshed-internal/stub_uploader/issues/90)
for more information about what external dependecies are allowed.
for more information about what external dependencies are allowed.
* `extra_description` (optional): Can be used to add a custom description to
the package's long description. It should be a multi-line string in
Markdown format.

View File

@@ -134,7 +134,7 @@ if sys.version_info >= (3, 9):
def joinpath(self, __child: str) -> Traversable: ...
# The documentation and runtime protocol allows *args, **kwargs arguments,
# but this would mean that all implementors would have to support them,
# but this would mean that all implementers would have to support them,
# which is not the case.
@overload
@abstractmethod

View File

@@ -85,7 +85,7 @@ class Field:
def process_formdata(self, valuelist: list[Any]) -> None: ...
def populate_obj(self, obj: object, name: str) -> None: ...
# this is a workaround for what is essentialy illegal in static type checking
# this is a workaround for what is essentially illegal in static type checking
# Field.__new__ would return an UnboundField, unless the _form parameter is
# specified. We can't really work around it by making UnboundField a subclass
# of Field, since all subclasses of Field still need to return an UnboundField

View File

@@ -14,7 +14,7 @@ class _SupportsGettextAndNgettext(Protocol):
def ngettext(self, __singular: str, __plural: str, __n: int) -> str: ...
# these are the methods WTForms depends on, the dict can either provide
# a getlist or getall, if it only provies getall, it will wrapped, to
# a getlist or getall, if it only provides getall, it will wrapped, to
# provide getlist instead
class _MultiDictLikeBase(Protocol):
def __iter__(self) -> Iterator[str]: ...
@@ -50,6 +50,6 @@ class DefaultMeta:
translations_cache: dict[str, _SupportsGettextAndNgettext]
def get_translations(self, form: BaseForm) -> _SupportsGettextAndNgettext: ...
def update_values(self, values: SupportsItems[str, Any]) -> None: ...
# since meta can be extended with arbitary data we add a __getattr__
# since meta can be extended with arbitrary data we add a __getattr__
# method that returns Any
def __getattr__(self, name: str) -> Any: ...

View File

@@ -119,7 +119,7 @@ webob.cachecontrol.UpdateDict.setdefault
# These need to be ignored due to how WebOb decided to let people know
# that certain methods on `NestedMultiDict` should not be called since
# they are immutable, compared to a MultiDict, but still can be used
# interchangeably in some parts of the API. So they re-use generic functions
# interchangeably in some parts of the API. So they reuse generic functions
# that accept any parameters and assign them to methods which should still
# satisfy the same interface. The type annotations enforce the correct
# input arguments instead of the generic ones.
@@ -148,6 +148,6 @@ webob.multidict.NoVars.__bool__
# so the type annotation is technically wrong, however I am unsure about
# whether the ResponseBodyFile would satisfy some of the IO Protocols if
# `write` was defined as a Callable instance attribute. It's hard to come up
# with a use-case where the distinction matters, besides inherting from
# with a use-case where the distinction matters, besides inheriting from
# the class and overwriting the __init__ and forgetting to populate `write`.
webob.response.ResponseBodyFile.write

View File

@@ -13,7 +13,7 @@ from webob.response import Response
_T = TypeVar("_T")
# we accept both the official spelling and the one used in the WebOb docs
# the implementation compares after lower() so technically there are more
# valid spellings, but it seems mor natural to support these two spellings
# valid spellings, but it seems more natural to support these two spellings
_SameSitePolicy: TypeAlias = Literal["Strict", "Lax", "None", "strict", "lax", "none"]
class _Serializer(Protocol):

View File

@@ -81,7 +81,7 @@ class Convertible(Typed[_T, _N]):
allow_none: Literal[False] = False,
) -> None: ...
# NOTE: It is currently impossible to make a generic based on the parameter type of another generic
# So we implement explicitely the types used internally
# So we implement explicitly the types used internally
# MultiCellRange
@overload
def __set__(
@@ -295,8 +295,8 @@ class Default(Typed[_T, _N]): # unused
) -> None: ...
def __call__(self) -> _T: ...
# Note: Aliases types can't be infered. Anyway an alias means there's another option
# incomplete: Make it generic with explicit getter/setter type arguments ?
# Note: Aliases types can't be inferred. Anyway an alias means there's another option.
# Incomplete: Make it generic with explicit getter/setter type arguments?
class Alias(Descriptor[Incomplete]):
alias: str
def __init__(self, alias: str) -> None: ...

View File

@@ -60,7 +60,7 @@ class NestedValue(Nested[_T], Convertible[_T, _N]): # type: ignore[misc]
@overload
def __get__(self: NestedValue[_T, Literal[False]], instance: Serialisable | Strict, cls: type | None = None) -> _T: ...
# NOTE: It is currently impossible to make a generic based on the parameter type of another generic
# So we implement explicitely the types used internally
# So we implement explicitly the types used internally
# str | Blip
@overload
def __set__(

View File

@@ -21,7 +21,7 @@ class Serialisable(metaclass=MetaSerialisable):
__elements__: ClassVar[tuple[str, ...]]
__namespaced__: ClassVar[tuple[tuple[str, str], ...]]
idx_base: int
# Needs overrides in many sub-classes. But a lot of subclasses are instanciated without overriding it, so can't be abstract
# Needs overrides in many sub-classes. But a lot of subclasses are instantiated without overriding it, so can't be abstract
# Subclasses "overrides" this property with a ClassVar, and Serialisable is too widely used,
# so it can't be typed as NoReturn either without introducing many false-positives.
@property

View File

@@ -47,7 +47,7 @@ def get_rels_path(path): ...
def get_dependents(archive: ZipFile, filename: str) -> RelationshipList: ...
# If `id` is None, `cls` needs to have ClassVar `rel_type`.
# The `deps` attribute used at runtime is for internal use immediatly after the return.
# The `deps` attribute used at runtime is for internal use immediately after the return.
# `cls` cannot be None
@overload
def get_rel(

View File

@@ -140,7 +140,7 @@ class Plotter:
pad_inches: float | None = None,
bbox_extra_artists: list[Artist] | None = None,
backend: str | None = None,
# Further **kwargs can truly be anything from an overriden Canvas method that is still passed down
# Further **kwargs can truly be anything from an overridden Canvas method that is still passed down
**kwargs: Any,
) -> Self: ...
# Same as matplotlib.backend_bases._Bases. No other backend override show

View File

@@ -93,7 +93,7 @@ if sys.version_info >= (3, 11):
# Ideally the first part should be `ExceptionGroup[ValueError]` (done)
# and the second part should be `BaseExceptionGroup[KeyError | SystemExit]`,
# but we cannot substract type from a union.
# but we cannot subtract type from a union.
# We also cannot change `BaseExceptionGroup` to `ExceptionGroup` even if needed
# in the second part here because of that.
assert_type(