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 <rep...@bugs.python.org>
<http://bugs.python.org/issue19678>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to