Implement Aspect-oriented programming

For example, the logging module is not very useful right now, as it requires sprinkling small one-liners all over my code - not exactly ideal. Why not take a page from aspect-oriented programming and allow for injection of code with point cuts?

On Sat, Jun 11, 2011 at 10:29, Jiawei Li <jiawei.h.li@gmail.com> wrote:
For example, the logging module is not very useful right now, as it requires sprinkling small one-liners all over my code - not exactly ideal. Why not take a page from aspect-oriented programming and allow for injection of code with point cuts?
I'm not sure why you would say this isn't allowed already... -- Lennart Regebro: http://regebro.wordpress.com/ Porting to Python 3: http://python3porting.com/

Hi! This mailing list is to work on developing Python (discussing bugs and patches). There is python-ideas mailing list to discuss possible future improvements. Oleg. -- Oleg Broytman http://phdru.name/ phd@phdru.name Programmers don't die, they just GOSUB without RETURN.

Jiawei Li <jiawei.h.li <at> gmail.com> writes:
For example, the logging module is not very useful right now, as it requires sprinkling small one-liners all over my code - not exactly ideal. Why not take a page from aspect-oriented programming and allow for injection of code with point cuts?
If you're only interested in logging method entry and exit - in which case, you're not really using logging to its full potential - then an AOP style approach may work for you. But the point of logging is to send messages to yourself (and others) from your code, and an AOP approach will not lend itself to intelligent, context-sensitive messages. Regards, Vinay Sajip
participants (4)
-
Jiawei Li
-
Lennart Regebro
-
Oleg Broytman
-
Vinay Sajip