Re: [Python-Dev] Implement Aspect-oriented programming

2011-06-13 Thread Vinay Sajip
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




___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Implement Aspect-oriented programming

2011-06-12 Thread Jiawei Li
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?
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Implement Aspect-oriented programming

2011-06-12 Thread Lennart Regebro
On Sat, Jun 11, 2011 at 10:29, Jiawei Li jiawei.h...@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/
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Implement Aspect-oriented programming

2011-06-12 Thread Oleg Broytman
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 Broytmanhttp://phdru.name/p...@phdru.name
   Programmers don't die, they just GOSUB without RETURN.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com