summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/visitors.py
diff options
context:
space:
mode:
authorYurii Karabas <1998uriyyo@gmail.com>2023-02-07 17:43:26 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2023-02-08 09:23:40 -0500
commit7e4c4b8d5c18100b0db58f4d29fac5494fc95b52 (patch)
tree7f1484bcd8ea413b46063a7f7309eea82718e79c /lib/sqlalchemy/sql/visitors.py
parent33dc651030b900bad31842df927fb8454b9a75d1 (diff)
downloadsqlalchemy-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/sql/visitors.py')
-rw-r--r--lib/sqlalchemy/sql/visitors.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/sqlalchemy/sql/visitors.py b/lib/sqlalchemy/sql/visitors.py
index 1a6719cce..79a163f67 100644
--- a/lib/sqlalchemy/sql/visitors.py
+++ b/lib/sqlalchemy/sql/visitors.py
@@ -594,11 +594,6 @@ _dispatch_lookup = HasTraversalDispatch._dispatch_lookup
_generate_traversal_dispatch()
-SelfExternallyTraversible = TypeVar(
- "SelfExternallyTraversible", bound="ExternallyTraversible"
-)
-
-
class ExternallyTraversible(HasTraverseInternals, Visitable):
__slots__ = ()
@@ -606,9 +601,7 @@ class ExternallyTraversible(HasTraverseInternals, Visitable):
if typing.TYPE_CHECKING:
- def _annotate(
- self: SelfExternallyTraversible, values: _AnnotationDict
- ) -> SelfExternallyTraversible:
+ def _annotate(self, values: _AnnotationDict) -> Self:
...
def get_children(
@@ -616,7 +609,7 @@ class ExternallyTraversible(HasTraverseInternals, Visitable):
) -> Iterable[ExternallyTraversible]:
...
- def _clone(self: Self, **kw: Any) -> Self:
+ def _clone(self, **kw: Any) -> Self:
"""clone this element"""
raise NotImplementedError()