homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Roy.Fox, ned.deily, python-dev, roger.serwy, terry.reedy
Date 2012年06月05日.09:21:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338888068.56.0.372797257527.issue12510@psf.upfronthosting.co.za>
In-reply-to
Content
By 'Python 3 only', I meant that I am not personally planning to backport to 2.7. I do not want to edit the more complicated get_arg_text and consider other issues higher priority.
 
I meant to include a test case for callable instances, but forgot. When 
I add to test class TC
" def __call__(self, ci): "(self, ci)"
tc( gives the inherited TC.__doc__ as the tool tip, which in this case happens to by the artificial "(ai=None, *b)".
Adding the following to get_argspec:
 # after current if is...type: fob = ...
 elif isinstance(ob.__call__, types.MethodType):
 fob = ob.__call__
&
 or isinstance(ob.__call__, types.MethodType)
 # to self-strip conditional, as instance is already typed 
&
 if isinstance(ob.__call__, types.MethodType):
 doc = ob.__call__.__doc__
 else:
 # before current doc = line, which gets indented
makes this new test pass.
 fdoc = tc.__call__.__doc__
 test('tc', fdoc + "\n" + fdoc)
Revised patch with above attached.
Note 1: Programming is more fun with decent tests.
Note 2: These non-visual automatic test do not completely substitute for visual testing with the gui. When I first used a broader conditional than the 'elif' above, one that caught list.append and [].append, the tests passed, but typing list.append( resulting in weird behavior: something flashed and the typed text moved down a line.
History
Date User Action Args
2012年06月05日 09:21:08terry.reedysetrecipients: + terry.reedy, ned.deily, roger.serwy, python-dev, Roy.Fox
2012年06月05日 09:21:08terry.reedysetmessageid: <1338888068.56.0.372797257527.issue12510@psf.upfronthosting.co.za>
2012年06月05日 09:21:08terry.reedylinkissue12510 messages
2012年06月05日 09:21:07terry.reedycreate

AltStyle によって変換されたページ (->オリジナル) /