Difference method vs attribut = function

Mats Wichmann mats at wichmann.us
Sat Jun 29 16:03:13 EDT 2024


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 trying to accomplish, you could take a look 
here (possibly a bit complex for what you need).

https://refactoring.guru/design-patterns/strategy/python/example





More information about the Python-list mailing list