[issue19678] smtpd.py: channel should be passed to process_message
R. David Murray
report at bugs.python.org
Mon Nov 25 18:13:38 CET 2013
R. David Murray added the comment:
I think this is reasonable. A patch would be welcome.
You could use inspect. When I had to do something similar I just did the call inside a try/except, caught TypeError and retried without the extra argument. See the __init__ of email.feedparser.FeedParser. I don't know which approach is better; although, with the new signature support in 3.4 perhaps inspecting the signature is better.
Another approach would be to designate a new method name for the new signature, and use hasattr to decide which to call. That's actually a bit more consistent with the way the SMTPChannel works.
----------
versions: +Python 3.5 -Python 3.4
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19678>
_______________________________________
More information about the Python-bugs-list
mailing list