Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I don't want to be young again, I just don't want to get any older.


devel / comp.lang.python / Re: Proposal: Syntax for attribute initialisation in __init__ methods

SubjectAuthor
o Re: Proposal: Syntax for attribute initialisation in __init__ methodsSam Ezeh

1
Re: Proposal: Syntax for attribute initialisation in __init__ methods

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

 copy mid

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

 copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: sam.z.e...@gmail.com (Sam Ezeh)
Newsgroups: comp.lang.python
Subject: Re: Proposal: Syntax for attribute initialisation in __init__ methods
Date: Wed, 20 Apr 2022 11:46:23 +0100
Lines: 46
Message-ID: <mailman.163.1650451597.20749.python-list@python.org>
References: <CAD+b3HgooPwsBw06+SOtc3S8d9-wFzjzS-CuQSoTeLGikcDvpQ@mail.gmail.com>
<e4dc2443-8ea4-b121-9ba2-0dc0ebc74723@DancesWithMice.info>
<CAD+b3HgmWTbnSX0DT5T7uudOBTOiSFDMhzrOe87RqTU64bc9JQ@mail.gmail.com>
<04553d03-7d71-1022-0a82-39321bd2ec83@DancesWithMice.info>
<CAD+b3HjJ1ovFwrPFWRg_2UyU_jriLNAwdx42=jVYfj+zUaRmww@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de b1OTJD58YATAR9q5GGMsAAsayyTYVMecQp6USJFO+RSA==
Return-Path: <sam.z.ezeh@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=WbZBbdky;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.011
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '2022': 0.05;
'improvement': 0.05; 'thread': 0.05; 'sun,': 0.07; '=dn': 0.09;
"shouldn't": 0.09; 'though.': 0.09; 'url:mailman': 0.15;
'applies': 0.16; 'arguments': 0.16; 'attributes,': 0.16;
'relatively': 0.16; 'removes': 0.16; 'subject:Syntax': 0.16;
'wrote:': 0.16; 'python': 0.16; "can't": 0.17; 'to:addr:python-
list': 0.20; 'maybe': 0.22; 'code': 0.23; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'discussion': 0.25; 'url:listinfo': 0.25; 'url-ip:188.166/16':
0.25; 'classes': 0.26; 'so.': 0.26; 'function': 0.27; 'approach':
0.31; 'url-ip:188/8': 0.31; 'wondering': 0.31; 'think': 0.32;
'question': 0.32; 'concern': 0.32; 'discussions': 0.32; 'keyword':
0.32; 'maintaining': 0.32; 'point,': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; "i'm": 0.33; "i'll": 0.33;
'subject:for': 0.33; 'there': 0.33; 'same': 0.34; 'header:In-
Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'missing': 0.37; "skip:' 10": 0.37;
'using': 0.37; 'received:209.85': 0.37; 'way': 0.38; 'could':
0.38; 'received:209': 0.39; 'two': 0.39; 'mentioned': 0.39;
'list': 0.39; 'methods': 0.39; 'subject:Proposal': 0.39; 'still':
0.40; 'advantage': 0.40; 'potential': 0.60; 'skip:o 10': 0.61;
'simply': 0.63; 'once': 0.63; 'skip:k 10': 0.64; 'order': 0.69;
'subject:skip:i 10': 0.69; 'extra': 0.84; 'discouraged': 0.84;
'criticism': 0.91; 'fall': 0.95; 'offer.': 0.96
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;
bh=8gIRpbbyzz3kY01arrLgomXJp6gr7SBZNstAFJvASAk=;
b=WbZBbdkyoR9/8kYbiKnJdnRZ7TIbpMIRQKWAj/DVH8BTdmeGaPCAuNTdWP6EQAHjrv
PaeDUq5P3A2sozUrXc3EbJ+COl6zCFgVQxjwEcXqAeen05RB/OBGVzu3dzSaidAJLk/l
+NTCeajKV1c5Ab3nrxC6f594572AA+T85iNP6Xl8hRUSE6kWzNp70YfoJ1VtH0U5JAnS
9v4RfBvCKA6wvAxrhDtoO3aIpXapJpD/HptP2UhsjfHMYQNmSIuHyWdPj2bJH5bgXIwd
0YLd7+2uw0UCb/2VQziiBlrOMg+jDZHF/2HkuFmS4bFrhHDfHh0Q1yLLwdkUzjahEcEn
PqQQ==
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;
bh=8gIRpbbyzz3kY01arrLgomXJp6gr7SBZNstAFJvASAk=;
b=H8HZ7V4BgVXazti0Ge4yIIBgrJbpduZ5XvH+AvQxsF6PtKpqlv3UQlE2uIIeabbRck
nqIZwu1SlCm6Y8k8TKAW1RfMf1H0XBTbe4M/EvVK8WUeMDH/Gix7FKiEh3C8Oh4y+y7M
nDYLgt2L9M3xy8yBxwfmkQurUI0onL7fMOJeGNgE+r/eUUBTUXk/YoG7bL/FVYYpXd1m
Vn6Wv+bh1R4h1maCLcSOuz9oymLsHe88qKxFCUErf+ehdQAfm11yK62tCLvXcJrHzF1V
ciHPc7CPxU29vc/E5Zu3y6g8KPFVieXVi0e60HIFLzYSzG8Jjg1Ji8EXTAZAagKFYUqy
0Srw==
X-Gm-Message-State: AOAM531Yxk7MLsnkB2vEl1LOUXbKYk4Q5lAEQABhzEKxwOjoLlDZ5CI6
9LOSLSk0jsbyyHafDLpKumMofib+DYLDi8ZbFORos9ATTPI=
X-Google-Smtp-Source: ABdhPJySv+KoSM4O7NSs7kdpusf1gjO/miN5+mMMI0JeHu1GbiZhFu+FJ8XAtLiR5hLT5hA3MLpoOy2wSw5EOauwdM0=
X-Received: by 2002:a17:902:da84:b0:15a:1214:2eab with SMTP id
j4-20020a170902da8400b0015a12142eabmr7231889plx.114.1650451594045; Wed, 20
Apr 2022 03:46:34 -0700 (PDT)
In-Reply-To: <04553d03-7d71-1022-0a82-39321bd2ec83@DancesWithMice.info>
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: <CAD+b3HjJ1ovFwrPFWRg_2UyU_jriLNAwdx42=jVYfj+zUaRmww@mail.gmail.com>
X-Mailman-Original-References: <CAD+b3HgooPwsBw06+SOtc3S8d9-wFzjzS-CuQSoTeLGikcDvpQ@mail.gmail.com>
<e4dc2443-8ea4-b121-9ba2-0dc0ebc74723@DancesWithMice.info>
<CAD+b3HgmWTbnSX0DT5T7uudOBTOiSFDMhzrOe87RqTU64bc9JQ@mail.gmail.com>
<04553d03-7d71-1022-0a82-39321bd2ec83@DancesWithMice.info>
 by: Sam Ezeh - Wed, 20 Apr 2022 10:46 UTC

I'll see if I can find out how positional only and keyword only
arguments are used in __init__ methods in the wild and I'll see if
there have been any other discussions talking about what this approach
could offer.

On Sun, 17 Apr 2022 at 02:54, dn <PythonList@danceswithmice.info> wrote:
>
> On 17/04/2022 09.20, Sam Ezeh wrote:
> >> Perhaps I'm missing the point, but what functionality or advantage(s)
> >> does this give, over data-classes?
> >
> > One advantage is maintaining control over the __init__ function without
> > having to write extra code to do so. In the linked discussion from
> > python-ideas, it was mentioned that keyword-only and positional-only
> > arguments can't be used with dataclasses [1].
> >
> >> Maybe Dataclasses are not being used as much as one might hope, but they
> >> are relatively new, and many Python-Masters simply carry-on constructing
> >> classes the way they have for years...
> >
> > I think one concern I have is that even if this is useful, it might
> > still fall to the same fate.
>
>
> Don't be discouraged by that - and that thread was not the first of such
> discussions! The way Python is being applied is continually changing...
>
> I'm not sure about the criticism of dataclasses though. Starting with
> 'explicit over implicit', once a parameter-list is more than two or
> three long, shouldn't we be using 'labels' in order to avoid (potential)
> confusion, ie keyword-parameters?
>
> This removes the order/sequence of arguments from the list of potential
> problems/gotchas one can fall into!
>
> In which case, I'm wondering just how often the criticism applies 'in
> real life'?
>
> So, now the question becomes: what are the cases/examples which
> require/desire improvement over the 'traditional' __init__ of
> attributes, and facilities offered through dataclasses?
> --
> Regards,
> =dn
> --
> https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor