What's a call-tip to do?

Terry Reedy tjreedy at udel.edu
Wed May 14 17:57:33 EDT 2008


"Tal Einat" <tal.no.no.spam at gmail.com> wrote in message 
news:8885effd-12a6-4e35-9629-ec4028afaa2d at 2g2000hsn.googlegroups.com...
| Hi all,
|
| I just ran into this. In IDLE (Python 2.5), the call-tip for
| itertools.count is:
| "x.__init__(...) initializes x; see x.__class__.__doc__ for signature"
|
| That's itertools.count.__init__.__doc__, while itertools.count.__doc__
| is the informative doc-string ("DS" henceforth):
| """count([firstval]) --> count object
|
| Return a count object whose .next() method returns consecutive
| integers starting from zero or, if specified, from firstval."""
|
|
| That seems very counter-intuitive to me - I would expect the DS for
| __init__ to explain how to use the constructor.
|
| IDLE's call-tip module obviously thinks so as it prefers the __init__
| DS to the class's DS. IPython does the opposite as far as I can tell,
| when I enter 'itertools.count?' it shows the class's DS, but shows
| nothing for a custom class whose __init__ has a DS while the class
| itself does not.
|
| I'm wondering what a call-tip mechanism should do when a class and its
| __init__ both have a DS. I'd be willing to work up a patch for IDLE's
| call-tip module to work better in this regard, or for itertools and
| similar classes in the stdlib, if needed.

Perhap IDLE should be changed, but I am not sure.  After more discussion 
here, if any, this would be worth a tracker item. 






More information about the Python-list mailing list