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/postgresql/dml.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/postgresql/dml.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/dml.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/dml.py b/lib/sqlalchemy/dialects/postgresql/dml.py index 5e569869e..a1807d7b3 100644 --- a/lib/sqlalchemy/dialects/postgresql/dml.py +++ b/lib/sqlalchemy/dialects/postgresql/dml.py @@ -6,8 +6,6 @@ # the MIT License: https://www.opensource.org/licenses/mit-license.php # mypy: ignore-errors -import typing - from . import ext from ... import util from ...sql import coercions @@ -19,6 +17,7 @@ from ...sql.base import ColumnCollection from ...sql.dml import Insert as StandardInsert from ...sql.elements import ClauseElement from ...sql.expression import alias +from ...util.typing import Self __all__ = ("Insert", "insert") @@ -44,9 +43,6 @@ def insert(table): return Insert(table) -SelfInsert = typing.TypeVar("SelfInsert", bound="Insert") - - class Insert(StandardInsert): """PostgreSQL-specific implementation of INSERT. @@ -100,13 +96,13 @@ class Insert(StandardInsert): @_generative @_on_conflict_exclusive def on_conflict_do_update( - self: SelfInsert, + self, constraint=None, index_elements=None, index_where=None, set_=None, where=None, - ) -> SelfInsert: + ) -> Self: r""" Specifies a DO UPDATE SET action for ON CONFLICT clause. @@ -168,11 +164,11 @@ class Insert(StandardInsert): @_generative @_on_conflict_exclusive def on_conflict_do_nothing( - self: SelfInsert, + self, constraint=None, index_elements=None, index_where=None, - ) -> SelfInsert: + ) -> Self: """ Specifies a DO NOTHING action for ON CONFLICT clause. |