Dom Grigonis wrote at 2023-11-16 21:11 +0200:
> ...
>> On 16 Nov 2023, at 21:00, Dieter Maurer <die...@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.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to