Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Seed me, Seymour" -- a random number generator meets the big green mother from outer space


devel / comp.lang.python / Re: __set_name__ equivalent for instance

SubjectAuthor
o Re: __set_name__ equivalent for instanceDieter Maurer

1
Re: __set_name__ equivalent for instance

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news-2.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: die...@handshake.de (Dieter Maurer)
Newsgroups: comp.lang.python
Subject: Re: __set_name__ equivalent for instance
Date: Thu, 16 Nov 2023 20:30:28 +0100
Lines: 18
Message-ID: <mailman.274.1700163033.3828.python-list@python.org>
References: <C459D5FA-DE60-4FA5-B7CF-284CB32D8DEE@gmail.com>
<25942.22823.215688.837713@ixdm.fritz.box>
<1E96390D-219C-4064-9C46-4F7BED89E324@gmail.com>
<25942.26334.931807.146304@ixdm.fritz.box>
<AAE2E7E5-52A8-489F-B9C7-1C57BA8FD959@gmail.com>
<25942.28116.545555.332868@ixdm.fritz.box>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de obEDGze3imAkeZeJvB9/FQu/4oh7Ak8jvYxAZ1CI/7Hw==
Cancel-Lock: sha1:LA29PqS4orMyguKCj+1Ebzg9qmk= sha256:xbYUxQAN6yRyivSAY2Hoesb0XXajan1vifNQigqQ8hQ=
Return-Path: <dieter@handshake.de>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.049
X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'is.': 0.05; 'binding':
0.09; 'cc:addr:python-list': 0.09; 'skip:` 10': 0.09; '21:00,':
0.16; 'accessed': 0.16; 'arbitrary': 0.16; 'cc:name:python': 0.16;
'creation,': 0.16; 'dieter': 0.16; 'instance': 0.16; 'instance)':
0.16; 'wrote:': 0.16; 'cc:addr:python.org': 0.20; 'language':
0.21; 'received:de': 0.23; 'cc:2**0': 0.25; 'objects': 0.32;
'but': 0.32; 'subject:for': 0.33; 'there': 0.33; 'header:In-Reply-
To:1': 0.34; 'yes,': 0.35; 'functions': 0.36; 'class': 0.37;
'way': 0.38; 'methods': 0.39; 'wrote': 0.39; 'method': 0.61;
'header:Received:6': 0.67; 'know.': 0.68; 'during': 0.69;
'documented': 0.76; 'reference.': 0.81; 'returned': 0.81;
'attribute': 0.84; 'dom': 0.84; 'handled': 0.84; 'received:88':
0.84
In-Reply-To: <AAE2E7E5-52A8-489F-B9C7-1C57BA8FD959@gmail.com>
X-Mailer: VM 8.0.12-devo-585 under 21.4 (patch 24) "Standard C" XEmacs Lucid
(x86_64-linux-gnu)
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: <25942.28116.545555.332868@ixdm.fritz.box>
X-Mailman-Original-References: <C459D5FA-DE60-4FA5-B7CF-284CB32D8DEE@gmail.com>
<25942.22823.215688.837713@ixdm.fritz.box>
<1E96390D-219C-4064-9C46-4F7BED89E324@gmail.com>
<25942.26334.931807.146304@ixdm.fritz.box>
<AAE2E7E5-52A8-489F-B9C7-1C57BA8FD959@gmail.com>
 by: Dieter Maurer - Thu, 16 Nov 2023 19:30 UTC

Dom Grigonis wrote at 2023-11-16 21:11 +0200:
> ...
>> On 16 Nov 2023, at 21:00, Dieter Maurer <dieter@handshake.de> wrote:
>> ...
>> Methods are not bound during instance creation, they are bound during
>> access.
>
>Good to know. What is the criteria for binding then? Does it check if its type is `vanilla` function? If yes, is there any way to simulate it for arbitrary object?

Attribute access (including method binding) is documented in the
language reference.

Functions and descriptors accessed via an instance but found in a class (i.e.
not directly in the instance) are handled specially;
functions are bound. Other objects are returned as is.

`__getattribute__` can be used to take over control over the attribute
access.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor