From 7cfa3b68c581c6a0f924933eacf7781d61bbf3b2 Mon Sep 17 00:00:00 2001 From: "Kian Meng, Ang" Date: Fri, 31 Dec 2021 16:38:37 +0800 Subject: [PATCH] Fix typos (#899) --- CHANGELOG.rst | 4 ++-- docs/hashing.rst | 2 +- docs/init.rst | 2 +- src/attr/_make.py | 2 +- tests/test_make.py | 2 +- tests/test_slots.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2ea83e4d..8ed9bf7e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -596,7 +596,7 @@ Changes `#349 `_ - The order of attributes that are passed into ``attr.make_class()`` or the *these* argument of ``@attr.s()`` is now retained if the dictionary is ordered (i.e. ``dict`` on Python 3.6 and later, ``collections.OrderedDict`` otherwise). - Before, the order was always determined by the order in which the attributes have been defined which may not be desirable when creating classes programatically. + Before, the order was always determined by the order in which the attributes have been defined which may not be desirable when creating classes programmatically. `#300 `_, `#339 `_, @@ -608,7 +608,7 @@ Changes - Setting the cell type is now completely best effort. This fixes ``attrs`` on Jython. - We cannot make any guarantees regarding Jython though, because our test suite cannot run due to dependency incompatabilities. + We cannot make any guarantees regarding Jython though, because our test suite cannot run due to dependency incompatibilities. `#321 `_, `#334 `_ diff --git a/docs/hashing.rst b/docs/hashing.rst index 30888f97..3e90f8cb 100644 --- a/docs/hashing.rst +++ b/docs/hashing.rst @@ -54,7 +54,7 @@ Because according to the definition_ from the official Python docs, the returned #. The hash of an object **must not** change. - If you create a class with ``@attr.s(frozen=True)`` this is fullfilled by definition, therefore ``attrs`` will write a ``__hash__`` function for you automatically. + If you create a class with ``@attr.s(frozen=True)`` this is fulfilled by definition, therefore ``attrs`` will write a ``__hash__`` function for you automatically. You can also force it to write one with ``hash=True`` but then it's *your* responsibility to make sure that the object is not mutated. This point is the reason why mutable structures like lists, dictionaries, or sets aren't hashable while immutable ones like tuples or frozensets are: diff --git a/docs/init.rst b/docs/init.rst index fb276ded..0c3f4cd7 100644 --- a/docs/init.rst +++ b/docs/init.rst @@ -345,7 +345,7 @@ And for that ``attrs`` offers three means: Pre Init ~~~~~~~~ -The sole reason for the existance of ``__attrs_pre_init__`` is to give users the chance to call ``super().__init__()``, because some subclassing-based APIs require that. +The sole reason for the existence of ``__attrs_pre_init__`` is to give users the chance to call ``super().__init__()``, because some subclassing-based APIs require that. .. doctest:: diff --git a/src/attr/_make.py b/src/attr/_make.py index d46f8a3e..072d5ff8 100644 --- a/src/attr/_make.py +++ b/src/attr/_make.py @@ -868,7 +868,7 @@ class _ClassBuilder(object): slot_names = [name for name in names if name not in base_names] # There are slots for attributes from current class # that are defined in parent classes. - # As their descriptors may be overriden by a child class, + # As their descriptors may be overridden by a child class, # we collect them here and update the class dict reused_slots = { slot: slot_descriptor diff --git a/tests/test_make.py b/tests/test_make.py index 729d3a71..498c98aa 100644 --- a/tests/test_make.py +++ b/tests/test_make.py @@ -235,7 +235,7 @@ class TestTransformAttrs(object): """ Converts all attributes, including base class' attributes, if `kw_only` is provided. Therefore, `kw_only` allows attributes with defaults to - preceed mandatory attributes. + precede mandatory attributes. Updates in the subclass *don't* affect the base class attributes. """ diff --git a/tests/test_slots.py b/tests/test_slots.py index baf9a40d..b560f233 100644 --- a/tests/test_slots.py +++ b/tests/test_slots.py @@ -490,7 +490,7 @@ class TestClosureCellRewriting(object): def test_code_hack_failure(self, monkeypatch): """ Keeps working if function/code object introspection doesn't work - on this (nonstandard) interpeter. + on this (nonstandard) interpreter. A warning is emitted that points to the actual code. """