diff options
author | Yurii Karabas <1998uriyyo@gmail.com> | 2023-02-07 17:43:26 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-02-08 09:23:40 -0500 |
commit | 7e4c4b8d5c18100b0db58f4d29fac5494fc95b52 (patch) | |
tree | 7f1484bcd8ea413b46063a7f7309eea82718e79c /lib/sqlalchemy/dialects/mysql/expression.py | |
parent | 33dc651030b900bad31842df927fb8454b9a75d1 (diff) | |
download | sqlalchemy-7e4c4b8d5c18100b0db58f4d29fac5494fc95b52.tar.gz |
Remove `typing.Self` workaround
Remove ``typing.Self`` workaround, now using :pep:`673` for most methods
that return ``Self``. Pull request courtesy Yurii Karabas.
Fixes: #9254
Closes: #9255
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9255
Pull-request-sha: 2947df8ada79f5c3afe9c838e65993302199c2f7
Change-Id: Ic32015ad52e95a61f3913d43ea436aa9402804df
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/expression.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/expression.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/expression.py b/lib/sqlalchemy/dialects/mysql/expression.py index 016ea251c..c5bd0be02 100644 --- a/lib/sqlalchemy/dialects/mysql/expression.py +++ b/lib/sqlalchemy/dialects/mysql/expression.py @@ -6,8 +6,6 @@ # mypy: ignore-errors -import typing - from ... import exc from ... import util from ...sql import coercions @@ -16,9 +14,7 @@ from ...sql import operators from ...sql import roles from ...sql.base import _generative from ...sql.base import Generative - - -Selfmatch = typing.TypeVar("Selfmatch", bound="match") +from ...util.typing import Self class match(Generative, elements.BinaryExpression): @@ -110,7 +106,7 @@ class match(Generative, elements.BinaryExpression): super().__init__(left, against, operators.match_op, modifiers=flags) @_generative - def in_boolean_mode(self: Selfmatch) -> Selfmatch: + def in_boolean_mode(self) -> Self: """Apply the "IN BOOLEAN MODE" modifier to the MATCH expression. :return: a new :class:`_mysql.match` instance with modifications @@ -121,7 +117,7 @@ class match(Generative, elements.BinaryExpression): return self @_generative - def in_natural_language_mode(self: Selfmatch) -> Selfmatch: + def in_natural_language_mode(self) -> Self: """Apply the "IN NATURAL LANGUAGE MODE" modifier to the MATCH expression. @@ -133,7 +129,7 @@ class match(Generative, elements.BinaryExpression): return self @_generative - def with_query_expansion(self: Selfmatch) -> Selfmatch: + def with_query_expansion(self) -> Self: """Apply the "WITH QUERY EXPANSION" modifier to the MATCH expression. :return: a new :class:`_mysql.match` instance with modifications |