summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
authorHarry Lees <harry.lees@gmail.com>2023-01-31 08:38:34 -0500
committermike bayer <mike_mp@zzzcomputing.com>2023-01-31 19:45:48 +0000
commit961f0762304db1db931d399e3b0b35cd99a4b21d (patch)
tree8e6cef11d3ff7b50643346c8d7b94bebd5e39036 /lib/sqlalchemy/dialects/postgresql/base.py
parent6d6a17240815b9090a2972607657f93d347167d6 (diff)
downloadsqlalchemy-961f0762304db1db931d399e3b0b35cd99a4b21d.tar.gz
Unify doc typing
### Description <!-- Describe your changes in detail --> Fixes #9168 This PR replaces common occurrences of [PEP 585](https://peps.python.org/pep-0585/) style type annotations with annotations compatible with older versions of Python. I searched for instances of the following supported types from the PEP and replaced with their legacy typing couterparts. * tuple # typing.Tuple * list # typing.List * dict # typing.Dict * set # typing.Set * frozenset # typing.FrozenSet * type # typing.Type ``` grep -r "list\[.*\]" ./build --exclude-dir="./build/venv/*" --exclude-dir="./build/output/*" --exclude="changelog_[0-9]*\.rst" ``` I excluded changelog files from being altered, I think some of these could be changed if necessary but others are likely to require manual checking as the change may target the new typing style specifically. For any examples that included imports, I tried to ensure that the correct typing imports were included and properly ordered. ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [x] A documentation / typographical error fix - Good to go, no issue or tests are needed - [ ] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. Closes: #9198 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9198 Pull-request-sha: 05ad4651b57c6275b29433e5e76e166344ba6c4c Change-Id: I41b93b3dee85f9fe00cfbb3d3eb011212795de29
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 009297583..d7e6634b3 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -1428,6 +1428,7 @@ import re
from typing import Any
from typing import List
from typing import Optional
+from typing import Tuple
from . import array as _array
from . import hstore as _hstore
@@ -3350,7 +3351,7 @@ class PGDialect(default.DefaultDialect):
else:
return False, {}
- def _kind_to_relkinds(self, kind: ObjectKind) -> tuple[str, ...]:
+ def _kind_to_relkinds(self, kind: ObjectKind) -> Tuple[str, ...]:
if kind is ObjectKind.ANY:
return pg_catalog.RELKINDS_ALL_TABLE_LIKE
relkinds = ()