]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix overlapping slots, base classes without slots
authorArie Bovenberg <a.c.bovenberg@gmail.com>
Tue, 1 Feb 2022 20:08:19 +0000 (15:08 -0500)
committersqla-tester <sqla-tester@sqlalchemy.org>
Tue, 1 Feb 2022 20:08:19 +0000 (15:08 -0500)
commit0409c88c297efa324218340b265a8d107d57deee
tree2337be6a74df17bd189a89a4c21254a50ed2d8ad
parentd6046f5fcf3732df1a8a08274501efcffc6253f2
Fix overlapping slots, base classes without slots

Some `__slots__` were not in order.

Fixes #7527

### Description

I'm fixing two types of slots mistakes:
- [x] remove overlapping slots (i.e. slots already defined on a base class)
- [x] fix broken inheritance (i.e. slots class inheriting from a non-slots class)
  - [x] slots added to base class `TransactionalContext`. It seemed to use two attributes, which I've added as slots.
  - [x] empty slots removed from `ORMOption`. Its base class explicitly makes use of `__dict__` so empty slots don't add anything.
  - [x] empty slots added to `PostLoader`. It doesn't appear to use any slots not already defined on its base classes.
  - [x] empty slots added to `IterateMappersMixin`. It doesn't appear to use any slots not already defined on its subclasses.
  - [x] empty slots added to `ImmutableContainer`. It doesn't use any fields.
  - [x] empty slots added to `OperatorType`. It's a protocol.
  - [x] empty slots added to `InternalTraversal`, `_HasTraversalDispatch`. They don't seem to use attributes on their own.

### Checklist

This pull request is:

- [x] 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.

**Have a nice day!**

Closes: #7589
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7589
Pull-request-sha: 70a9c4d46916b7c6907eb1d3ad4f7033ec964191

Change-Id: I6c6e3e69c3c34d0f3bdda7f0684849834fdd1863
12 files changed:
lib/sqlalchemy/cyextension/immutabledict.pyx
lib/sqlalchemy/dialects/mysql/aiomysql.py
lib/sqlalchemy/dialects/sqlite/aiosqlite.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/row.py
lib/sqlalchemy/engine/util.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/unitofwork.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/operators.py
lib/sqlalchemy/sql/visitors.py