Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Baby On Board.


devel / comp.lang.python / Re: Could frozendict or frozenmap be of some use for PEP 683 (Immortal objects)?

SubjectAuthor
o Re: Could frozendict or frozenmap be of some use for PEP 683Martin Di Paola

1
Re: Could frozendict or frozenmap be of some use for PEP 683 (Immortal objects)?

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: martinp....@gmail.com (Martin Di Paola)
Newsgroups: comp.lang.python
Subject: Re: Could frozendict or frozenmap be of some use for PEP 683
(Immortal objects)?
Date: Wed, 9 Mar 2022 22:27:10 +0000
Lines: 26
Message-ID: <mailman.254.1646864838.2329.python-list@python.org>
References: <CABbU2U-aUuv4beQZ55aacmTmh7JqsMwcJk8PA+2Bu9GbT9RUFw@mail.gmail.com>
<20220309222710.qzg25vclyeqmgcsd@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Trace: news.uni-berlin.de VtlAJlpuZz2n3ksPXiGyjQsH/EqKSBZbwvdN8piQldNg==
Return-Path: <martinp.dipaola@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=FS/KAyOg;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.020
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '2022': 0.05; 'mar': 0.07;
'pep': 0.07; 'memory.': 0.09; 'objects,': 0.09; 'url:mailman':
0.15; 'memory': 0.15; 'default.': 0.16; 'dict': 0.16; 'heavy':
0.16; 'object,': 0.16; 'wrote:': 0.16; 'instead': 0.17; "can't":
0.17; 'message-id:@gmail.com': 0.18; 'to:addr:python-list': 0.20;
'goal': 0.23; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'url:listinfo': 0.25; 'url-
ip:188.166/16': 0.25; 'object': 0.26; 'sense': 0.28; 'url-
ip:188/8': 0.31; 'program': 0.31; 'think': 0.32; 'objects': 0.32;
'but': 0.32; 'subject:for': 0.33; 'same': 0.34; "didn't": 0.34;
'fill': 0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'from:addr:gmail.com': 0.35; 'those': 0.36; 'really': 0.37;
'received:209.85': 0.37; 'could': 0.38; 'received:209': 0.39;
'subject:PEP': 0.39; 'use': 0.39; 'wed,': 0.39; 'happen': 0.40;
'true': 0.63; 'imagine': 0.64; 'subject:some': 0.69; 'truly':
0.70; 'little': 0.73; 'thousands': 0.78; 'quickly': 0.80;
'strings': 0.84; 'subject:Could': 0.84; 'sulla': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=date:from:to:subject:message-id:mail-followup-to:'user-agent
:references:mime-version:content-disposition:in-reply-to;
bh=XxhPyEVQzuQ+i85jbkQCzYDhH8MfilM2ebGlGjEg4QU=;
b=FS/KAyOguKwIRo4PGXpRz2k68c/CjRgOXqZ3gYnE+EwAyd9Xs5OPhxpJnv16JaQuhL
UYpschwTxoxSq1KfBAS3952DuOD2utZrKrU1UjVeJlEIQohduzJvjhUaRF2Dty9Dj93k
NJDEa67M6SA9On0S28ae/2/fbKAkiP0Plk15GOZ721rtd/F0HS/iJws5JrhC4ZA0EOZm
MBRD5c8O/SM95UWerLNxdlvP8KZ8OZ4sfUcJk5DYN6PCTwOy7Y9rW9CpozM0OOERNsNz
NomvIq+IKNcG8dZEYllZUZfZaSdaI6Uszu7AxDv6Kqg5+oEMNiwu20RV2sBlldqX6HtG
M9Xg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to
:'user-agent:references:mime-version:content-disposition:in-reply-to;
bh=XxhPyEVQzuQ+i85jbkQCzYDhH8MfilM2ebGlGjEg4QU=;
b=LZ7lwOpeOFi+9M7AgLKQJ0puAHN7F4Tqu72WaL7tceH3DWnDNZLx5TfGbs7SLZXC56
FYtOi6k0MrpSpqO0EeYf/dxZOqG2Ql+I9wrBCB/0tzlFiGic2M1J9JHVYnixiUUoG/xg
OmLWq5E+EPUBBDjI8pRX99Ae5yimAIbbXyfc1OIZbyP+UIkLYhIZrZ7jo4E9GJFLZF7I
eHW0Uk87BfONfZuKZnVeNT40g//xlLRun2SAqhNvEbnDcUCjDkIZ2uf0X2TLmhq8fq2F
w1+NlotkhpAkw2q4cMPig2DGxltr7+E6JQfMHPMjBfxVbj/1Lt9Cd+E9jIMvM538NXK1
7ZTQ==
X-Gm-Message-State: AOAM530nsiV4kow23UY4sfanFvf6tWgeLt5VHTGF6KPcfdDi5b2/k9Zt
mmhT9N/eikq2hPv/eXggxqC6AQNdi98=
X-Google-Smtp-Source: ABdhPJydbhDsZirmyBmzF9RnBCSCAWhk2eNnRHlfrtGtCDXXdL9wy4V7d9bC/26iDSfwOJ7rpg5wAA==
X-Received: by 2002:a05:6808:1592:b0:2d9:fd1a:1a69 with SMTP id
t18-20020a056808159200b002d9fd1a1a69mr7769030oiw.110.1646864835367;
Wed, 09 Mar 2022 14:27:15 -0800 (PST)
Mail-Followup-To: Python List <python-list@python.org>
'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Thunderbird/52.5.2 Lightning/5.4.5.2'
Content-Disposition: inline
In-Reply-To: <CABbU2U-aUuv4beQZ55aacmTmh7JqsMwcJk8PA+2Bu9GbT9RUFw@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: <20220309222710.qzg25vclyeqmgcsd@gmail.com>
X-Mailman-Original-References: <CABbU2U-aUuv4beQZ55aacmTmh7JqsMwcJk8PA+2Bu9GbT9RUFw@mail.gmail.com>
 by: Martin Di Paola - Wed, 9 Mar 2022 22:27 UTC

I perhaps didn't understand the PEP completely but I think that the goal
of marking some objects as immortal is to remove the refcount from they.

For immutable objects that would make them truly immutable.

However I don't think that the immortality could be applied to any
immutable object by default.

Think in the immutable strings (str). What would happen with a program
that does heavy parsing? I imagine that it will generate thousands of
little strings. If those are immortal, the program will fill its memory
very quickly as the GC will not reclaim their memory.

The same could happen with any frozenfoo object.

Leaving immortality to only a few objects, like True and
None makes more sense as they are few (bound if you want).

On Wed, Mar 09, 2022 at 09:16:00PM +0100, Marco Sulla wrote:
>As title. dict can't be an immortal object, but hashable frozendict
>and frozenmap can. I think this can increase their usefulness.
>
>Another advantage: frozen dataclass will be really immutable if they
>could use a frozen(dict|map) instead of a dict as __dict__
>--
>https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor