]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
support slice access for .c
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 22 Apr 2023 13:41:49 +0000 (09:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 22 Apr 2023 16:20:43 +0000 (12:20 -0400)
commitd62de424ef738a0cfb9c682d9b25a8644dff5985
treef97f37ade36b3f97cb608757b9b1cbd589fe074b
parentb3e01c30d2610f5454eda5b29f093b65e54230b5
support slice access for .c

Added support for slice access with :class:`.ColumnCollection`, e.g.
``table.c[0:5]``, ``subquery.c[:-1]`` etc. Slice access returns a sub
:class:`.ColumnCollection` in the same way as passing a tuple of keys. This
is a natural continuation of the key-tuple access added for :ticket:`8285`,
which it appears to be an oversight that this usage was omitted.

Change-Id: I6378642f39501ffbbae4acadf1dc38a43c39d722
References: #8285
References: #9690
doc/build/changelog/unreleased_20/c_slice.rst [new file with mode: 0644]
lib/sqlalchemy/sql/base.py
test/ext/mypy/plain_files/selectables.py [new file with mode: 0644]
test/sql/test_select.py