Timeline for Introspection to get decorator names on a method?
Current License: CC BY-SA 2.5
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 10, 2021 at 18:45 | comment | added | ragazzojp | This basically works only for your custom @register decorator, we need a more general solution. | |
| Jul 12, 2010 at 22:16 | vote | accept | Tony | ||
| Jul 12, 2010 at 22:01 | comment | added | Faisal | You can, but then you'll have to dirty every decorator you write with the cross-cutting concern of leaving its tracks behind in the function it modifies. | |
| Jul 12, 2010 at 21:23 | comment | added | Tony | Ok this could work, but why can't I just add the code func._whatever='something' into my existing decorator, and test for the value of the _whatever attribute when performing introspection on the method? | |
| Jul 12, 2010 at 21:15 | comment | added | Faisal | This is a great solution. :D It does assume you have access to the code that's assigning the decorators, though... | |
| Jul 12, 2010 at 20:53 | history | answered | unutbu | CC BY-SA 2.5 |