Aug. 12, 2021
10:56 a.m.
Hi. I am working on a kinda-ORM library, which usage often implies to request data within specific ranges: Foobar.search( attr1="foo", attr2=gt(10), attr3=between(42, 50) ) The use of "gt" or "between" methods to describe those operations feels a bit cumbersome (as it is long to write, and you need to import those functions in a lot of files), and I though it could be more pythonic to use slices instead. Foobar.search( attr1="foo", attr2=slice(10), attr3=slice(42, 50) ) I suggest an alternative way to instanciate slices, that would look like this: Foobar.search( attr1="foo", attr2=[10:], attr3=[42:50] ) What do you think?