[Python-ideas] __before__ and __after__ attributes for functions

Chris Angelico rosuav at gmail.com
Thu Jan 23 08:52:31 CET 2014


On Thu, Jan 23, 2014 at 6:20 PM, Suresh V. <suresh_vv at yahoo.com> wrote:
> Can we add these two attributes for every function/method where each is a
> list of callables with the same arguments as the function/method itself?
>
> Pardon me if this has been discussed before. Pointers to past discussions
> (if any) appreciated.

I'm not exactly sure what you're looking for here. What causes a
callable to be added to a function's __before__ list, and/or what will
be done with it?

If you mean that they'll be called before and after the function
itself, that can be more cleanly done with a decorator.

ChrisA


More information about the Python-ideas mailing list