"Carsten Haese" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> If none of the examples make you say
> "wow, I could use this" and if you don't find yourself writing
> repetitive setup/teardown/housekeeping code, you can probably live quite
> comfortably without using decorators.
>

Amen!  Don't force yourself to learn decorators if you don't need them at 
the moment.  Wait until you start repeating the same code (lock/unlock, 
dbready/dbcommit, logstart/logend, etc.) around multiple functions, then go 
back and try applying a decorator to simplify the job.  Having a real use 
for them will make it much easier to "get".

I will say, though, that I found the memoizing decorator to be especially 
intriguing and eye-opening, and didn't realize I needed it until I saw it 
laid out in front of me.

-- Paul


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to