Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Hailing frequencies open, Captain.


devel / comp.lang.python / Re: Why operations between dict views return a set and not a frozenset?

SubjectAuthor
o Re: Why operations between dict views return a set and not aMarco Sulla

1
Re: Why operations between dict views return a set and not a frozenset?

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Marco.Su...@gmail.com (Marco Sulla)
Newsgroups: comp.lang.python
Subject: Re: Why operations between dict views return a set and not a
frozenset?
Date: Tue, 4 Jan 2022 21:03:58 +0100
Lines: 15
Message-ID: <mailman.99.1641326677.3079.python-list@python.org>
References: <CABbU2U9EBev-MWb+5j=uUZJaYAtKHw+raAviOFpd50d9ojsA2w@mail.gmail.com>
<CAPTjJmoRm26RiPsfhSph_Zwj=gJFyDN47u3kcvxfQPSM+fTf1g@mail.gmail.com>
<CABbU2U9Pazu_yjdm8veY+VnsGLpq9axSEXmF-eJrTV3ZjHax3g@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de pwbp7e+2i+MKQdCCFuobMQ2j563hgi6RukY+IbkSBpGg==
Return-Path: <elbarbun@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=Ps7tTb8p;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '2022': 0.05;
'subject:Why': 0.07; 'underlying': 0.07; 'angelico': 0.09;
'cc:addr:python-list': 0.09; 'construct': 0.09;
'received:209.85.219': 0.09; 'set.': 0.09; 'subject:between':
0.09; 'subject:not': 0.09; '(when': 0.16; 'cc:name:python list':
0.16; 'dict': 0.16; 'elements.': 0.16; 'from:name:marco sulla':
0.16; 'subject:operations': 0.16; 'tuples': 0.16; 'wrote:': 0.16;
'tue,': 0.19; 'cc:addr:python.org': 0.20; 'cc:2**0': 0.25;
'seems': 0.26; 'chris': 0.28; 'message-id:@mail.gmail.com': 0.32;
'but': 0.32; 'same': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'change': 0.36; "it's": 0.37; 'received:209.85': 0.37;
'received:209': 0.39; 'difficult': 0.40; 'something': 0.40;
'should': 0.40; 'view': 0.60; 'remember': 0.61; 'items': 0.68;
'sentence': 0.69; 'change,': 0.76; 'returned': 0.81; 'property':
0.88
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=ZzzuNPoZyDZBHXg0UTvSYrw0ZAuQVYotSbicG7L5DrY=;
b=Ps7tTb8pROB7m+JuGW8+RousLtEUyg8/mR/tVoLuNFF2ueQLWCg+AUlC6htHBAyJ4D
A62h70GSDuPVxDR6ArSJOt4XEK63Zkg0UTrZdBek0+qnNN/bf36DubLhR1vtNJboWXVk
hooHIiC2PmxjkkVtpyf/ciFkyBGfqYMdMZLEka2Jrm+ne4wIwFxNC8qztvNHF7bGXbJe
CZzvPB4Uf4ScSjltLvVMuZQ6W0vzyovg+fHuLO7azevTuXU4lO0HTb5Nx6TOD0Op9Vw9
1hlQ+itcgoCP/b8JXBbkelTxfqvgTCGbiQv1HgfzskDmp9xEJ9NTPb3bp/ha7gceQos8
78kg==
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=ZzzuNPoZyDZBHXg0UTvSYrw0ZAuQVYotSbicG7L5DrY=;
b=ky0Kux2WkUbgsabEVYdeQxDlEMnflB5wO+hhhcO7ecEXeAVfNXi6p4DwbJgSyB+QP4
qIRngDlf2Uhkq6ZmYGmXE9OYmD25A/x7e9X3eUCABieYc5g2MvMmpsSddXL1ia1yULYW
eM0ivq5LPN2Mtm+7+gIvSCP99+Bcr7lLqFc8MZTArAuKmowSWssaD1zmPxVfUWUnSGml
c7yU+0tMfZBKjceKJDmuCMAaZ7JlOfKW2HJkMA46etftEH21WX2JHv8TwTIGuRgVWzea
vSeN+003vzwhFbFzUpnQqUCf7xNhpZ2ZTDoZ2jdyPW1yawL6QMdHN9Ks1p8uxwM9qTWA
ORIg==
X-Gm-Message-State: AOAM532dK5Zu+TGIx9FDtxOcOnIx4g+iAmAHitTwFR44Yn21LBQQfZLf
KX8UIn/w3yaP4/VyisKtBS/kTTOku3fSzMqoL6/igZDbTfc=
X-Google-Smtp-Source: ABdhPJxfqigem9AHk5vz54NCHYWKD/5fWDduj6W28UpD+2kCjjof6Nj+Fnx/8B5xXPWZxQeAE+1mLavVboGLF7Iq6qs=
X-Received: by 2002:a25:24d1:: with SMTP id
k200mr46409154ybk.512.1641326674798;
Tue, 04 Jan 2022 12:04:34 -0800 (PST)
In-Reply-To: <CAPTjJmoRm26RiPsfhSph_Zwj=gJFyDN47u3kcvxfQPSM+fTf1g@mail.gmail.com>
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: <CABbU2U9Pazu_yjdm8veY+VnsGLpq9axSEXmF-eJrTV3ZjHax3g@mail.gmail.com>
X-Mailman-Original-References: <CABbU2U9EBev-MWb+5j=uUZJaYAtKHw+raAviOFpd50d9ojsA2w@mail.gmail.com>
<CAPTjJmoRm26RiPsfhSph_Zwj=gJFyDN47u3kcvxfQPSM+fTf1g@mail.gmail.com>
 by: Marco Sulla - Tue, 4 Jan 2022 20:03 UTC

On Tue, 4 Jan 2022 at 19:38, Chris Angelico <rosuav@gmail.com> wrote:
> [...] should the keys view be considered
> frozen or not? Remember the set of keys can change (when the
> underlying dict changes).

Well, also the items can change, but they are returned as tuples with
2 elements.

It seems to me that the stdlib, when something should return a
sequence, prefers to return a tuple. So I expected the same preference
for frozenset over set.

> It's not difficult to construct a frozenset from a set.

This sentence has the commutative property :)

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor