23 Jan
2014
23 Jan
'14
9:58 a.m.
On Thu, Jan 23, 2014 at 8:52 PM, Suresh V.
Correct. I want to say something like:
from functools import prepostcall smtplib.SMTP.sendmail = prepostcall(smtplib.SMTP.sendmail) smtplib.SMTP.sendmail.before.append(other_function)
This seems less error-prone. And more conducive to multiple patching.
Easy. Just replace the import statement with the def that I gave above, and then it works. Or make your own module of "handy stuff" and use that. Not everything has to be in the stdlib :) ChrisA