]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Unify doc typing
authorHarry Lees <harry.lees@gmail.com>
Tue, 31 Jan 2023 13:38:34 +0000 (08:38 -0500)
committermike bayer <mike_mp@zzzcomputing.com>
Tue, 31 Jan 2023 19:45:48 +0000 (19:45 +0000)
commit961f0762304db1db931d399e3b0b35cd99a4b21d
tree8e6cef11d3ff7b50643346c8d7b94bebd5e39036
parent6d6a17240815b9090a2972607657f93d347167d6
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
19 files changed:
doc/build/changelog/changelog_20.rst
doc/build/changelog/migration_20.rst
doc/build/orm/basic_relationships.rst
doc/build/orm/collection_api.rst
doc/build/orm/declarative_styles.rst
doc/build/orm/extensions/associationproxy.rst
doc/build/orm/extensions/asyncio.rst
doc/build/orm/inheritance.rst
doc/build/orm/large_collections.rst
doc/build/orm/queryguide/_inheritance_setup.rst
doc/build/orm/queryguide/relationships.rst
doc/build/orm/quickstart.rst
doc/build/tutorial/orm_related_objects.rst
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/ext/asyncio/base.py
lib/sqlalchemy/ext/automap.py
lib/sqlalchemy/ext/mutable.py
lib/sqlalchemy/orm/decl_api.py