I didn't like it either. But I don't think that it is possible to solve this purely using decorator functions.
Methods need an instance to work correctly. At the time decorators are executed there are no instances yet. They are executed during the class definition, and instance can't be created before class is defined. Perhaps some magic using meta classes and meta programming can help, but it would be even harder to read and understand than it is now. Vitalije -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/acced0ec-c806-4581-9042-4d1ad7966aed%40googlegroups.com.
