A good decorator library

Felipe Bastos Nunes felipe.bastosn at gmail.com
Sun Oct 24 16:33:59 CEST 2010


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 <timr at probo.com>:
> Felipe Bastos Nunes <felipe.bastosn at 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, timr at probo.com
> Providenza & Boekelheide, Inc.
> --
> http://mail.python.org/mailman/listinfo/python-list
>


-- 
Felipe Bastos Nunes



More information about the Python-list mailing list