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
An alternative suggestion, which works today (... is a valid object called
Ellipsis):
Foobar.search(
attr1="foo",
attr2=[10, ...],
attr3=[42, ..., 50]
)
On Thu, Aug 12, 2021 at 8:44 AM wrote:
> Hi. I am working on a kinda-ORM library, which usage often implies to
On 2021-08-12 at 08:56:22 -,
[email protected] wrote:
> 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
On Thu, Aug 12, 2021 at 9:02 AM Calvin Spealman wrote:
> An alternative suggestion, which works today (... is a valid object called
> Ellipsis):
>
>Foobar.search(
> attr1="foo",
> attr2=[10, ...],
> attr3=[42, ..., 50]
> )
>
This got me thinking just now: allowing
This is how slices are used in the python standard library, indeed, but that
does not stop me from interpreting the slices as "inclusive by default" in my
library.
The inconsistency with the rest of the python standard library could be
misleading, but I think maybe less than off-by-1 errors?
Yo
Definitively not as short as what I suggested, but I love it. I think this is
one of the cleanest way I can do right now. Thanks!
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https
On Fri, Aug 13, 2021 at 12:00 AM Ricky Teachey wrote:
>
> On Thu, Aug 12, 2021 at 9:02 AM Calvin Spealman wrote:
>>
>> An alternative suggestion, which works today (... is a valid object called
>> Ellipsis):
>>
>>Foobar.search(
>> attr1="foo",
>> attr2=[10, ...],
>> a
On 2021-08-12 at 14:05:23 -,
[email protected] wrote:
> This is how slices are used in the python standard library, indeed,
> but that does not stop me from interpreting the slices as "inclusive
> by default" in my library. The inconsistency with the rest of the
> python standard libra
On Thu, Aug 12, 2021 at 09:57:06AM -0400, Ricky Teachey wrote:
> This got me thinking just now: allowing ellipses instead of None for the
> first two arguments of the slice() constructor might be a neat idea.
Like this?
>>> obj = slice(..., ..., 5)
>>> print(obj)
slice(Ellipsis, Ellipsis, 5)
Th
On Thu, Aug 12, 2021 at 5:16 PM Steven D'Aprano wrote:
> On Thu, Aug 12, 2021 at 09:57:06AM -0400, Ricky Teachey wrote:
>
> > This got me thinking just now: allowing ellipses instead of None for the
> > first two arguments of the slice() constructor might be a neat idea.
>
> Like this?
>
> >>> ob
10 matches
Mail list logo