Re: [PATCH] bindings/python-cffi: fix typos

Subject: Re: [PATCH] bindings/python-cffi: fix typos

Date: Thu, 20 Mar 2025 21:19:08 +0100

To: notmuch@notmuchmail.org

Cc:

From: Floris Bruynooghe


On Wed 19 Mar 2025 at 20:28 +0100, Jakub Wilk wrote:

> ---
>  bindings/python-cffi/notmuch2/__init__.py  |  2 +-
>  bindings/python-cffi/notmuch2/_base.py     |  4 ++--
>  bindings/python-cffi/notmuch2/_config.py   |  2 +-
>  bindings/python-cffi/notmuch2/_database.py |  4 ++--
>  bindings/python-cffi/notmuch2/_message.py  | 10 +++++-----
>  bindings/python-cffi/notmuch2/_tags.py     |  6 +++---
>  6 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/bindings/python-cffi/notmuch2/__init__.py b/bindings/python-cffi/notmuch2/__init__.py
> index b1cd21c1..978e01c2 100644
> --- a/bindings/python-cffi/notmuch2/__init__.py
> +++ b/bindings/python-cffi/notmuch2/__init__.py
> @@ -22,7 +22,7 @@ Libnotmuch uses a hierarchical memory allocator, this means all
>  objects have a strict parent-child relationship and when the parent is
>  freed all the children are freed as well.  This has some implications
>  for these Python bindings as parent objects need to be kept alive.
> -This is normally schielded entirely from the user however and the
> +This is normally shielded entirely from the user however and the
>  Python objects automatically make sure the right references are kept
>  alive.  It is however the reason the :class:`BaseObject` exists as it
>  defines the API all Python objects need to implement to work
> diff --git a/bindings/python-cffi/notmuch2/_base.py b/bindings/python-cffi/notmuch2/_base.py
> index c83abd01..1b0b5b7e 100644
> --- a/bindings/python-cffi/notmuch2/_base.py
> +++ b/bindings/python-cffi/notmuch2/_base.py
> @@ -28,7 +28,7 @@ class NotmuchObject(metaclass=abc.ABCMeta):
>  
>      However during some peculiar situations, e.g. interpreter
>      shutdown, it is possible for the :meth:`__del__` method to have
> -    been called, whele there are still references to an object.  This
> +    been called, while there are still references to an object.  This
>      could result in child objects asking their memory to be freed
>      after the parent has already freed the memory, making things
>      rather unhappy as double frees are not taken lightly in C.  To
> @@ -174,7 +174,7 @@ class NotmuchIter(NotmuchObject, collections.abc.Iterator):
>      :type parent: NotmuchObject
>      :param iter_p: The CFFI pointer to the C iterator.
>      :type iter_p: cffi.cdata
> -    :param fn_destory: The CFFI notmuch_*_destroy function.
> +    :param fn_destroy: The CFFI notmuch_*_destroy function.
>      :param fn_valid: The CFFI notmuch_*_valid function.
>      :param fn_get: The CFFI notmuch_*_get function.
>      :param fn_next: The CFFI notmuch_*_move_to_next function.
> diff --git a/bindings/python-cffi/notmuch2/_config.py b/bindings/python-cffi/notmuch2/_config.py
> index 603fdcbf..4df03bd0 100644
> --- a/bindings/python-cffi/notmuch2/_config.py
> +++ b/bindings/python-cffi/notmuch2/_config.py
> @@ -35,7 +35,7 @@ class ConfigIter(base.NotmuchIter):
>  
>  class ConfigMapping(base.NotmuchObject, collections.abc.MutableMapping):
>      """The config key/value pairs loaded from the database, config file,
> -    and and/or defaults.
> +    and/or defaults.
>  
>      The entries are exposed as a :class:`collections.abc.MutableMapping` object.
>      Note that setting a value to an empty string is the same as deleting it.
> diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py
> index d7485b4d..08b252af 100644
> --- a/bindings/python-cffi/notmuch2/_database.py
> +++ b/bindings/python-cffi/notmuch2/_database.py
> @@ -351,7 +351,7 @@ class Database(base.NotmuchObject):
>          The returned context manager can be used to perform atomic
>          operations on the database.
>  
> -        .. note:: Unlinke a traditional RDBMS transaction this does
> +        .. note:: Unlike a traditional RDBMS transaction this does
>             not imply durability, it only ensures the changes are
>             performed atomically.
>  
> @@ -416,7 +416,7 @@ class Database(base.NotmuchObject):
>          :raises XapianError: A Xapian exception occurred.
>          :raises FileError: The file referred to by ``pathname`` could
>             not be opened.
> -        :raises FileNotEmailError: The file referreed to by
> +        :raises FileNotEmailError: The file referred to by
>             ``pathname`` is not recognised as an email message.
>          :raises ReadOnlyDatabaseError: The database is opened in
>             READ_ONLY mode.
> diff --git a/bindings/python-cffi/notmuch2/_message.py b/bindings/python-cffi/notmuch2/_message.py
> index 7bd20331..79485238 100644
> --- a/bindings/python-cffi/notmuch2/_message.py
> +++ b/bindings/python-cffi/notmuch2/_message.py
> @@ -344,7 +344,7 @@ class Message(base.NotmuchObject):
>  
>          Instead the map has an additional :meth:`PropertiesMap.getall`
>          method which can be used to retrieve all properties of a given
> -        key.  This method also allows iterating of a a subset of the
> +        key.  This method also allows iterating of a subset of the
>          keys starting with a given prefix.
>          """
>          try:
> @@ -428,7 +428,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping):
>      """A mutable mapping to manage properties.
>  
>      Both keys and values of properties are supposed to be UTF-8
> -    strings in libnotmuch.  However since the uderlying API uses
> +    strings in libnotmuch.  However since the underlying API uses
>      bytestrings you can use either str or bytes to represent keys and
>      all returned keys and values use :class:`BinString`.
>  
> @@ -486,7 +486,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping):
>          return len(list(it))
>  
>      def __getitem__(self, key):
> -        """Return **the first** peroperty associated with a key."""
> +        """Return **the first** property associated with a key."""
>          if isinstance(key, str):
>              key = key.encode('utf-8')
>          value_pp = capi.ffi.new('char**')
> @@ -509,7 +509,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping):
>          """Return a :class:`collections.abc.ItemsView` for this map.
>  
>          The ItemsView treats a ``(key, value)`` pair as unique, so
> -        dupcliate ``(key, value)`` pairs will be merged together.
> +        duplicate ``(key, value)`` pairs will be merged together.
>          However duplicate keys with different values will be returned.
>          """
>          items = set()
> @@ -524,7 +524,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping):
>          return PropertiesItemsView(items)
>  
>      def values(self):
> -        """Return a :class:`collecions.abc.ValuesView` for this map.
> +        """Return a :class:`collections.abc.ValuesView` for this map.
>  
>          All unique property values are included in the view.
>          """
> diff --git a/bindings/python-cffi/notmuch2/_tags.py b/bindings/python-cffi/notmuch2/_tags.py
> index ee5d2a34..28528831 100644
> --- a/bindings/python-cffi/notmuch2/_tags.py
> +++ b/bindings/python-cffi/notmuch2/_tags.py
> @@ -69,7 +69,7 @@ class ImmutableTagSet(base.NotmuchObject, collections.abc.Set):
>          return self.iter(encoding='utf-8', errors='ignore')
>  
>      def iter(self, *, encoding=None, errors='strict'):
> -        """Aternate iterator constructor controlling string decoding.
> +        """Alternate iterator constructor controlling string decoding.
>  
>          Tags are stored as bytes in the notmuch database, in Python
>          it's easier to work with unicode strings and thus is what the
> @@ -87,7 +87,7 @@ class ImmutableTagSet(base.NotmuchObject, collections.abc.Set):
>          """
>          # self._cffi_fn should point either to
>          # notmuch_database_get_all_tags, notmuch_thread_get_tags or
> -        # notmuch_message_get_tags.  nothmuch.h suggests these never
> +        # notmuch_message_get_tags.  notmuch.h suggests these never
>          # fail, let's handle NULL anyway.
>          tags_p = self._cffi_fn(self._ptr())
>          if tags_p == capi.ffi.NULL:
> @@ -155,7 +155,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
>      Tags are bytestrings and calling ``iter()`` will return an
>      iterator yielding bytestrings.  However the :meth:`iter` method
>      can be used to return tags as unicode strings, while all other
> -    operations accept either byestrings or unicode strings.  In case
> +    operations accept either bytestrings or unicode strings.  In case
>      unicode strings are used they will be encoded using utf-8 before
>      being passed to notmuch.
>      """

LGTM, thanks for fixing all these!
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: