Pythonwin is terrible!

Mark Hammond mhammond at skippinet.com.au
Fri Jun 9 20:34:46 EDT 2000


"Boudewijn Rempt" <boud at rempt.xs4all.nl> wrote in message
news:8hrhqa$afm$1 at news1.xs4all.nl...

Thanks for your nice comments about Pythonwin!

[BTW - Im not at all fazed by the start of this thread - I know lots of
people enjoy Pythonwin!  But Ive been waiting for an opportunity to use
that "where the sun dont shine, sunshine" line for a while now :-]

> The lookups aren't that great - they only find what you've already used
> in that file. I'd like loopup to look in every file that's included for
> completion. But I'm not going to complain - it's good for my memory not
> to have it ;-).

This is amazingly hard to do correctly - and the hard bits are not related
to Pythonwin!

The problem can be expressed without any regard for a GUI.  If it can be
solved generically, Pythonwin, IDLE and any other IDEs could use it to.
Indeed, I did the original IDLE CallTips for Pythonwin, then ported it to
IDLE.  If I could get Pythonwin's AutoComplete to give good results most
of the time,  would happily port that to IDLE too (incentive for
non-Windows users to think about this:).

The problem is simply this:  Given an arbitary location in an arbitary
source file, give me a representation of the Python object at that
location.  This representation must have enough info to deduce the
signature (if a callable object) and all attributes suitable for an
auto-complete type list.  The object itself would be perfect, but this is
not practical.

Further, this must be done without any Python introspection capabilities.
Introspection could be used only for already imported code.  Executing
something like "CallTips" or "AutoComplete" should never execute users
code, as the side effects can't be predicted.  This restriction generally
means you can't rely on introspection at all.  Further, introspection can
only solve the easy 20% of the problem :-)  And to further complicate
matters, thus must work on syntactically incorrect code (the syntax is
_never_ correct when autocomplete or calltips are actually displayed!)

So if anyone can come up with generic code that can do this, all current
and future IDEs for Python could benefit.

Mark.





More information about the Python-list mailing list