Message204366
| Author |
r.david.murray |
| Recipients |
barry, lpolzer, r.david.murray |
| Date |
2013年11月25日.17:13:37 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1385399618.14.0.463605289914.issue19678@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年11月25日 17:13:38 | r.david.murray | set | recipients:
+ r.david.murray, barry, lpolzer |
| 2013年11月25日 17:13:38 | r.david.murray | set | messageid: <1385399618.14.0.463605289914.issue19678@psf.upfronthosting.co.za> |
| 2013年11月25日 17:13:38 | r.david.murray | link | issue19678 messages |
| 2013年11月25日 17:13:37 | r.david.murray | create |
|