I thought about that. I won't use decorators for all the things. I will use it only to free the simulator users to set which methods they wanna log or save in a statistic, eq.: number of packets sent, received, lost...
2010/10/24, Tim Roberts <t...@probo.com>: > Felipe Bastos Nunes <felipe.bast...@gmail.com> wrote: >> >>Hi! I was looking for a good decorator library to study and make my >>own decorators. I've read the Bruce Eckel's blog at artima dot com. >>But I need some more examples. I'm building a WSN simulator like SHOX >>is in java, but programming it in python. I'd like to use decorators >>to set methods that would be logged as statistics and some more >>funcionalities like check a method to check the params' types. > > Be careful with this. Decorators have their uses, but it is very easy to > make a program completely unreadable through the unjudicious use of > decorators. > > It is not good programming to use a language freature just because it is > there. > -- > Tim Roberts, t...@probo.com > Providenza & Boekelheide, Inc. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Felipe Bastos Nunes -- http://mail.python.org/mailman/listinfo/python-list