From 909ec85c5d9dea50ec137d183b6975e55c7190c1 Mon Sep 17 00:00:00 2001 From: luzpaz Date: Wed, 30 Mar 2022 13:33:50 -0400 Subject: [PATCH] Fix typos (#12495) Found via `codespell -q 3 -S ./mypyc/external/googletest -L alo,ans,asend,ba,bre,dne,fo,haa,ist,larg,myu,nams,spawnve,statics,thow,ure,whet,wont,zar` --- docs/source/common_issues.rst | 2 +- docs/source/literal_types.rst | 4 ++-- mypy/api.py | 2 +- mypy/message_registry.py | 2 +- mypyc/doc/introduction.rst | 2 +- mypyc/test-data/run-classes.test | 2 +- test-data/unit/check-enum.test | 2 +- test-data/unit/check-unions.test | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/source/common_issues.rst b/docs/source/common_issues.rst index c4adc9b563bd..9d0961894a7e 100644 --- a/docs/source/common_issues.rst +++ b/docs/source/common_issues.rst @@ -607,7 +607,7 @@ method signature. E.g.: The third line elicits an error because mypy sees the argument type ``bytes`` as a reference to the method by that name. Other than -renaming the method, a work-around is to use an alias: +renaming the method, a workaround is to use an alias: .. code-block:: python diff --git a/docs/source/literal_types.rst b/docs/source/literal_types.rst index 2bca6db71ac7..8aad55c392e0 100644 --- a/docs/source/literal_types.rst +++ b/docs/source/literal_types.rst @@ -431,7 +431,7 @@ You can use enums to annotate types as you would expect: self.speed = speed Movement(Direction.up, 5.0) # ok - Movement('up', 5.0) # E: Argument 1 to "Movemement" has incompatible type "str"; expected "Direction" + Movement('up', 5.0) # E: Argument 1 to "Movement" has incompatible type "str"; expected "Direction" Exhaustiveness checking *********************** @@ -505,7 +505,7 @@ the same way Python's runtime does: left = 'left' right = 'right' -- All ``Enum`` fields are implictly ``final`` as well. +- All ``Enum`` fields are implicitly ``final`` as well. .. code-block:: python diff --git a/mypy/api.py b/mypy/api.py index f6e40b4fc3ec..28e8d835c7f8 100644 --- a/mypy/api.py +++ b/mypy/api.py @@ -3,7 +3,7 @@ Since mypy still changes, the API was kept utterly simple and non-intrusive. It just mimics command line activation without starting a new interpreter. So the normal docs about the mypy command line apply. -Changes in the command line version of mypy will be immediately useable. +Changes in the command line version of mypy will be immediately usable. Just import this module and then call the 'run' function with a parameter of type List[str], containing what normally would have been the command line diff --git a/mypy/message_registry.py b/mypy/message_registry.py index 78fe07f70c92..8b5452d5753d 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -211,7 +211,7 @@ def format(self, *args: object, **kwargs: object) -> "ErrorMessage": # Enum ENUM_MEMBERS_ATTR_WILL_BE_OVERRIDEN: Final = ErrorMessage( - 'Assigned "__members__" will be overriden by "Enum" internally' + 'Assigned "__members__" will be overridden by "Enum" internally' ) # ClassVar diff --git a/mypyc/doc/introduction.rst b/mypyc/doc/introduction.rst index 547643a3705c..874071bac23f 100644 --- a/mypyc/doc/introduction.rst +++ b/mypyc/doc/introduction.rst @@ -139,7 +139,7 @@ Mypyc uses several techniques to produce fast code: * Mypyc treats compiled functions, classes, and attributes declared ``Final`` as immutable. -* Mypyc has memory-efficient, unboxed representions for integers and +* Mypyc has memory-efficient, unboxed representations for integers and booleans. Development status diff --git a/mypyc/test-data/run-classes.test b/mypyc/test-data/run-classes.test index 83838e188762..e238c2b02284 100644 --- a/mypyc/test-data/run-classes.test +++ b/mypyc/test-data/run-classes.test @@ -1816,7 +1816,7 @@ class B(A): def x(self, val : int) -> None: self._x = val + 1 -#Inerits base property setters and getters +# Inherits base property setters and getters class C(A): def __init__(self) -> None: A.__init__(self) diff --git a/test-data/unit/check-enum.test b/test-data/unit/check-enum.test index 2504e8e0e9c3..84ac3904772a 100644 --- a/test-data/unit/check-enum.test +++ b/test-data/unit/check-enum.test @@ -2064,7 +2064,7 @@ import typing from enum import Enum class WritingMembers(Enum): - __members__: typing.Dict[Enum, Enum] = {} # E: Assigned "__members__" will be overriden by "Enum" internally + __members__: typing.Dict[Enum, Enum] = {} # E: Assigned "__members__" will be overridden by "Enum" internally class OnlyAnnotatedMembers(Enum): __members__: typing.Dict[Enum, Enum] diff --git a/test-data/unit/check-unions.test b/test-data/unit/check-unions.test index 63b090e5743c..c3802a46ff41 100644 --- a/test-data/unit/check-unions.test +++ b/test-data/unit/check-unions.test @@ -273,7 +273,7 @@ reveal_type(u(1, C())) # N: Revealed type is "Union[__main__.C, builtins.int]" reveal_type(u(1, a)) # N: Revealed type is "Union[Any, builtins.int]" reveal_type(u(a, 1)) # N: Revealed type is "Union[builtins.int, Any]" -# Any and base-class-Any, no simplificaiton +# Any and base-class-Any, no simplification reveal_type(u(C(), a)) # N: Revealed type is "Union[Any, __main__.C]" reveal_type(u(a, C())) # N: Revealed type is "Union[__main__.C, Any]"