Ulrich Goebel wrote at 2024-6-28 18:08 +0200:
>Hi,
>
>a class can have methods, and it can have attributes, which can hold a
>function. Both is well known, of course.
>
>My question: Is there any difference?
I think you should make the distinction "class versus instance attribute"
rather than "me
On 6/28/2024 12:08 PM, Ulrich Goebel via Python-list wrote:
Hi,
a class can have methods, and it can have attributes, which can hold a
function. Both is well known, of course.
My question: Is there any difference?
The code snipped shows that both do what they should do. But __dict__ includes
On 6/28/24 10:08, Ulrich Goebel via Python-list wrote:
By the way: in my usecase I want to pass different functions to different
instances of MyClass. It is in the context of a database app where I build
Getters for database data and pass one Getter per instance.
If I understood what you're
On 2024-06-28 18:08:54 +0200, Ulrich Goebel via Python-list wrote:
> a class can have methods, and it can have attributes, which can hold a
> function. Both is well known, of course.
>
> My question: Is there any difference?
>
> The code snipped shows that both do what they should do. But __dict_
Hi,
a class can have methods, and it can have attributes, which can hold a
function. Both is well known, of course.
My question: Is there any difference?
The code snipped shows that both do what they should do. But __dict__ includes
just the method, while dir detects the method and the attribu