Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

VMS is like a nightmare about RXS-11M.


devel / comp.lang.python / Re: Comparing sequences with range objects

SubjectAuthor
o Re: Comparing sequences with range objectsDan Stromberg

1
Re: Comparing sequences with range objects

<mailman.73.1649646918.20749.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22186&group=comp.lang.python#22186

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: drsalists@gmail.com (Dan Stromberg)
Newsgroups: comp.lang.python
Subject: Re: Comparing sequences with range objects
Date: Sun, 10 Apr 2022 20:15:03 -0700
Lines: 39
Message-ID: <mailman.73.1649646918.20749.python-list@python.org>
References: <98f69f0d-3909-ca13-a440-1d226164b9a5@vub.be>
<CAGGBd_oZVtrikd8=fEYi-4grmUgGtUrv_dyBzShUr+VZoUD_gA@mail.gmail.com>
<CAGGBd_pn9WGesOPq07NnS9Wgr56tdtGtsH0dHhoR0ie2nOUTig@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de QLjBQ8/nDeVw1K2IR33l3wzxZSOyPTyE85U3FH0Z5qBw==
Return-Path: <drsalists@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=d1SIY0Aw;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '2022': 0.05; 'modules':
0.07; 'sun,': 0.07; 'cases.': 0.09; 'cc:addr:python-list': 0.09;
'dan': 0.09; 'url-ip:151.101.0.223/32': 0.09; 'url-
ip:151.101.128.223/32': 0.09; 'url-ip:151.101.192.223/32': 0.09;
'url-ip:151.101.64.223/32': 0.09; 'url:mailman': 0.15; 'memory':
0.15; 'antoon': 0.16; 'arithmetic': 0.16; 'cc:name:python list':
0.16; 'eg:': 0.16; 'from:addr:drsalists': 0.16; 'from:name:dan
stromberg': 0.16; 'pardon': 0.16; 'pardon.': 0.16; 'relatively':
0.16; 'sounds': 0.16; 'things:': 0.16; 'url:latest': 0.16;
'url:project': 0.16; 'url:pypi': 0.16; 'wrote:': 0.16; 'problem':
0.16; 'thu,': 0.19; 'cc:addr:python.org': 0.20; 'maybe': 0.22;
'url-ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'cc:2**0': 0.25; 'url-ip:188.166/16': 0.25;
'object': 0.26; 'bit': 0.27; 'function': 0.27; 'done': 0.28;
'purpose': 0.28; 'url-ip:188/8': 0.31; 'objects': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; 'there': 0.33; 'same':
0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'item': 0.35; 'url-ip:104.17/16': 0.35; 'from:addr:gmail.com':
0.35; 'using': 0.37; 'received:209.85': 0.37; 'way': 0.38;
'could': 0.38; 'received:209': 0.39; 'two': 0.39; 'list': 0.39;
'use': 0.39; 'still': 0.40; 'want': 0.40; '10,': 0.61; 'url-
ip:151.101.0/24': 0.62; 'url-ip:151.101.128/24': 0.62; 'url-
ip:151.101.192/24': 0.62; 'url-ip:151.101.64/24': 0.62; 'range':
0.64; 'key': 0.64; 'down': 0.64; 'less': 0.65; 'url:5': 0.67;
'per': 0.68; 'items': 0.68; 'little': 0.73; 'easy': 0.74;
'moment': 0.81; 'comparable': 0.84; 'wasting': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=ZBECrJ+HWwwuS+82r7OeYUwYWKbZQoe4c155+TMDsp0=;
b=d1SIY0AwRkrM49+nr5hQaiKrYlLm96qFymOMrzMr9710B+SIXanocwEtFHBurRJJQB
lGnR3zpZ6R4NAnzvcqO4Jq+kEak+qqfa+CzjBiF7Wr0yRE0nyLRkxTniDvZB5sQVa6KV
JoFOSZQmsP69SsuwFDwpuG/TBG2hjvIYD65oHudUyCTPE3JFm/GQ078gULt0P+hdVmq9
Zr2hZoqUQwYzq0128WB2rqvAB7QTaJI3LmBCwxjAabv6aOa6oSzgZ+NoGWjkiZnjdtqO
DK9zoPNQcIy+0Shf+WNVMdqbBF0wk1HnQRK+TYG3scRtAuxaScDWLiMZAUHjjvcME6cA
cGSA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=ZBECrJ+HWwwuS+82r7OeYUwYWKbZQoe4c155+TMDsp0=;
b=jZk189uNthFU3GjqknFa3SJGKOX93lVKfeSwcZoszSeurRYV9Q44G0JsKcrNT4fohf
0lpet+dgGikoa/9vOu3iab9oqf6MPJm2abLfHSy3xAO1xRsQC/MgdaX7Hr+wIhOQ6F9b
gMT3TfTNsjRRT+q4dhHAgDbFspI/8CcAtO8Y0HbFWU5G6Upw//8sKceHWB+xLwkl2uiW
UucHTN5HOKDZlt52myDS8JnJhHhvL4dykPqpzFIDh5pVCClh2T+iTZm0qMo42bScOqc2
5f9Ovh7WlJIOP9JiuVl+XcfcuhuMQSE+DOyvM+x7YPXncXeyCfbZzDNVqED6tglQUNke
0F3g==
X-Gm-Message-State: AOAM531HfPWOUjxa0g/g1JdmTJpw96xzzUk7woGbfSPeQK/KYciEzStH
GUOtmmeZqsDE4WXP7+HKQr0J11AmFsEvKute9AMazFwR+no=
X-Google-Smtp-Source: ABdhPJyybZq8Yl4kjNXd2PyM2W7dKAkLxZhwxhk9shi8ZyO5jP/SuhuhHO1tait6RlPkjjFf1Wx104f1SiUqjpduf74=
X-Received: by 2002:a05:6122:c97:b0:345:654e:58eb with SMTP id
ba23-20020a0561220c9700b00345654e58ebmr1666601vkb.13.1649646915340; Sun, 10
Apr 2022 20:15:15 -0700 (PDT)
In-Reply-To: <CAGGBd_oZVtrikd8=fEYi-4grmUgGtUrv_dyBzShUr+VZoUD_gA@mail.gmail.com>
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAGGBd_pn9WGesOPq07NnS9Wgr56tdtGtsH0dHhoR0ie2nOUTig@mail.gmail.com>
X-Mailman-Original-References: <98f69f0d-3909-ca13-a440-1d226164b9a5@vub.be>
<CAGGBd_oZVtrikd8=fEYi-4grmUgGtUrv_dyBzShUr+VZoUD_gA@mail.gmail.com>
 by: Dan Stromberg - Mon, 11 Apr 2022 03:15 UTC

Two more things:
1) There are also modules that do interval arithmetic with reals, not just
integers. EG: https://pyinterval.readthedocs.io/en/latest/
2) If you don't mind a small amount of inaccuracy you can often get things
down to less than one bit per element for presence/absence, using a bloom
filter. EG: https://pypi.org/project/drs-bloom-filter/

On Sun, Apr 10, 2022 at 5:31 PM Dan Stromberg <drsalists@gmail.com> wrote:

>
> It sounds a little like you're looking for interval arithmetic.
>
> Maybe https://pypi.org/project/python-intervals/1.5.3/ ?
>
> On Thu, Apr 7, 2022 at 4:19 AM Antoon Pardon <antoon.pardon@vub.be> wrote:
>
>> I am working with a list of data from which I have to weed out duplicates.
>> At the moment I keep for each entry a container with the other entries
>> that are still possible duplicates.
>>
>> The problem is sometimes that is all the rest. I thought to use a range
>> object for these cases. Unfortunatly I sometimes want to sort things
>> and a range object is not comparable with a list or a tuple.
>>
>> So I have a list of items where each item is itself a list or range
>> object.
>> I of course could sort this by using list as a key function but that
>> would defeat the purpose of using range objects for these cases.
>>
>> So what would be a relatively easy way to get the same result without
>> wasting
>> too much memory on entries that haven't any weeding done on them.
>>
>> --
>> Antoon Pardon.
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>


devel / comp.lang.python / Re: Comparing sequences with range objects

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor