From 56256b6d132c0deae4368a7d0d04912df9a80fc0 Mon Sep 17 00:00:00 2001 From: luz paz Date: Fri, 10 Dec 2021 09:10:29 -0500 Subject: Fix various source comment/doc typos ### Description Found via `codespell -q 3 -L ba,crate,datas,froms,gord,hist,inh,nd,selectin,strat,ue` Also added codespell to the pep8 tox env ### Checklist This pull request is: - [x] A documentation / typographical error fix - Good to go, no issue or tests are needed Closes: #7338 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7338 Pull-request-sha: 0deac2219396bc0eba7da53eb3a80932edbf2dd7 Change-Id: Icd61db31c8dc655d4a39d8a304194804d08555fe --- lib/sqlalchemy/dialects/postgresql/psycopg.py | 2 +- lib/sqlalchemy/engine/base.py | 2 +- lib/sqlalchemy/engine/cursor.py | 2 +- lib/sqlalchemy/ext/mypy/util.py | 2 +- lib/sqlalchemy/orm/path_registry.py | 4 ++-- lib/sqlalchemy/orm/query.py | 2 +- lib/sqlalchemy/orm/strategy_options.py | 2 +- lib/sqlalchemy/pool/base.py | 2 +- lib/sqlalchemy/sql/type_api.py | 2 +- lib/sqlalchemy/util/langhelpers.py | 4 ++-- 10 files changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg.py b/lib/sqlalchemy/dialects/postgresql/psycopg.py index 4219b4fff..911f46183 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg.py @@ -43,7 +43,7 @@ The asyncio version of the dialect may also be specified explicitly using the asyncio_engine = create_async_engine("postgresql+psycopg_async://scott:tiger@localhost/test") The ``psycopg`` dialect has the same API features as that of ``psycopg2``, -with the exeption of the "fast executemany" helpers. The "fast executemany" +with the exception of the "fast executemany" helpers. The "fast executemany" helpers are expected to be generalized and ported to ``psycopg`` before the final release of SQLAlchemy 2.0, however. diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index b11ffd871..470cfb449 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -187,7 +187,7 @@ class Connection(ConnectionEventsTarget): keeping the effect of such an option localized to a "sub" connection. .. versionchanged:: 2.0 The :meth:`_engine.Connection.execution_options` - method, in constrast to other objects with this method, modifies + method, in contrast to other objects with this method, modifies the connection in-place without creating copy of it. As discussed elsewhere, the :meth:`_engine.Connection.execution_options` diff --git a/lib/sqlalchemy/engine/cursor.py b/lib/sqlalchemy/engine/cursor.py index 8247987fa..99a0b65ed 100644 --- a/lib/sqlalchemy/engine/cursor.py +++ b/lib/sqlalchemy/engine/cursor.py @@ -331,7 +331,7 @@ class CursorResultMetaData(ResultMetaData): as with textual non-ordered columns. The name-matched system of merging is the same as that used by - SQLAlchemy for all cases up through te 0.9 series. Positional + SQLAlchemy for all cases up through the 0.9 series. Positional matching for compiled SQL expressions was introduced in 1.0 as a major performance feature, and positional matching for textual :class:`_expression.TextualSelect` objects in 1.1. diff --git a/lib/sqlalchemy/ext/mypy/util.py b/lib/sqlalchemy/ext/mypy/util.py index 4d55cb728..0eefdb20f 100644 --- a/lib/sqlalchemy/ext/mypy/util.py +++ b/lib/sqlalchemy/ext/mypy/util.py @@ -245,7 +245,7 @@ def unbound_to_instance( # TODO: figure out a more robust way to check this. The node is some # kind of _SpecialForm, there's a typing.Optional that's _SpecialForm, - # but I cant figure out how to get them to match up + # but I can't figure out how to get them to match up if typ.name == "Optional": # convert from "Optional?" to the more familiar # UnionType[..., NoneType()] diff --git a/lib/sqlalchemy/orm/path_registry.py b/lib/sqlalchemy/orm/path_registry.py index f2768a6b6..7b04a798c 100644 --- a/lib/sqlalchemy/orm/path_registry.py +++ b/lib/sqlalchemy/orm/path_registry.py @@ -313,8 +313,8 @@ class TokenRegistry(PathRegistry): def __getitem__(self, entity): try: return self.path[entity] - except TypeError as te: - raise IndexError(f"{entity}") from te + except TypeError as err: + raise IndexError(f"{entity}") from err class PropRegistry(PathRegistry): diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index a2e247f14..018fb703d 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -378,7 +378,7 @@ class Query( # it to provide a real expression object. # # from there, it starts to look much like Query itself won't be - # passed into the execute process and wont generate its own cache + # passed into the execute process and won't generate its own cache # key; this will all occur in terms of the ORM-enabled Select. if ( not self._compile_options._set_base_alias diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py index 02068adce..6fcdfb27b 100644 --- a/lib/sqlalchemy/orm/strategy_options.py +++ b/lib/sqlalchemy/orm/strategy_options.py @@ -802,7 +802,7 @@ class _AbstractLoad(Generative, LoaderOption): # scenario which should only be occurring in a loader # that is against a non-aliased lead element with # single path. otherwise the - # "B" wont match into the B(B, B2). + # "B" won't match into the B(B, B2). # # i>=2 prevents this check from proceeding for # the first path element. diff --git a/lib/sqlalchemy/pool/base.py b/lib/sqlalchemy/pool/base.py index 77e4761e8..984a497c7 100644 --- a/lib/sqlalchemy/pool/base.py +++ b/lib/sqlalchemy/pool/base.py @@ -792,7 +792,7 @@ class PoolProxiedConnection: pool. :class:`.PoolProxiedConnection` is basically the public-facing interface - for the :class:`._ConnectionFairy` implemenatation object, users familiar + for the :class:`._ConnectionFairy` implementation object, users familiar with :class:`._ConnectionFairy` can consider this object to be equivalent. diff --git a/lib/sqlalchemy/sql/type_api.py b/lib/sqlalchemy/sql/type_api.py index cc226d7e3..9d9b91cad 100644 --- a/lib/sqlalchemy/sql/type_api.py +++ b/lib/sqlalchemy/sql/type_api.py @@ -1742,7 +1742,7 @@ class TypeDecorator(ExternalType, SchemaEventTarget, TypeEngine): in a result row subsequent to statement execution time. Subclasses of :class:`_types.TypeDecorator` can override this method - to provide custom column expresion behavior for the type. This + to provide custom column expression behavior for the type. This implementation will **replace** that of the underlying implementation type. diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index 52182a4f7..361b35010 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -1894,8 +1894,8 @@ def inject_param_text(doctext, inject_params): lines.extend([line, to_inject, "\n"]) to_inject = None elif line.endswith("::"): - # TODO: this still wont cover if the code example itself has blank - # lines in it, need to detect those via indentation. + # TODO: this still won't cover if the code example itself has + # blank lines in it, need to detect those via indentation. lines.extend([line, doclines.popleft()]) continue lines.append(line) -- cgit v1.2.1