Hi Pierre,

Sorry for taking so long to answer this important issue. Now I understand your motivation quite clearly and I see it as a very interesting new feature. It would be very useful if you're working on big scripts or projects where you can't easily import them or evaluate every function in them to see their docstrings on the object inspector.

But besides the problem you mention (rope can't get docstrings for some builtins), there are the usability problems I mentioned in my first email: you can't get the entire docstring of an object wtih rope (or so it seems to me) and so it's not possible to show it in rich text mode. I think this a serious issue because if you're on the Editor and try to see the np.vectorize docstring, for example, you'll see the one given by rope instead of the original one, which is a real drawback to me.

I don't what to do. Maybe it would be better to undo this change for now and explore its consequences further in a dedicated branch? I think the idea is worth the trying and if we could get rope to give us the full docstring, we could easily sphinxify it :-)

Carlos

El 18/01/11 08:24, Pierre Raybaut escribió:
Hi Carlos,

Here is the reason why I've introduced the "Source" combo box in the
Object Inspector.
The fact is that the Object Inspector was originally designed to be
used from the Console only. Then after having implemented the
"Automatic import" feature, it made sense to call the Object Inspector
from the Editor too. But, because of the way the inspector works,
there was an unexpected behavior when editing a script which was not
in sys.path because the inspector can't import it and show associated
documentation. I first tried to systematically add opened script
directories to sys.path (for the internal console only, of course) but
when editing a script which can't be imported having the same name as
a module which *can* be imported, the Object Inspector was unable to
show documentation relative to the right module. I try to eventually
deeply reload modules as a workaround but it never worked as expected
(and the fact to systematically reload modules before inspecting them
was not a clean solution at all).

However, 'rope' feature are always working as expected in this kind of
situation. That's the reason why I thought of using rope 'get_doc'
function to retrieve the documentation at the same time as the
"calltip" text: it's working in all situations and it's faster than
asking the inspector to import the module ('rope' is not taking
additionnal time to get documentation).
So, that's why I've introduced this "Source" combo box: to show the
documentation text retrieved by rope.

After that, I found out that it was not as fine as I initially thought
because 'rope' is apparently unable to retrive documentation for some
builtins (e.g. sorted, reverse, ...) which is quite disappointing...

Maybe it's not the best change ever :-)

So, given the explanations above, I'm very open to suggestions.

Cheers,
Pierre

On Jan 18, 3:26 am, Carlos Córdoba<[email protected]>  wrote:
Hi Pierre,

I've noticed you introduced a "Source" combo box in the object inspector
to separate from where it comes a petition to it, if it's from the
console or from editor. That's what I understand you wanted to do,
please correct if I'm wrong.

I would want to know why you saw the need to make this kind of change.
Is it because the editor gets too slow when you have turned on the
feature "Automatic notification to the object inspector"? Or are there
other reasons?

I'd like to know your reasons because, after trying the feature for a
while, I think it's a step back. I've found that when you're on the
editor, rope only shows the signature of the function/method you want to
inspect, and for a quite short time. Besides, when you press Ctrl+I, you
are directed as always to the object inspector, but the "Source" box
doesn't change to "Editor", it remains on "Console". Finally, when you
manually change to "Editor", you see only a short and pale version of
the object's docstring (the one given by rope I guess), which I think is
of not much help.

Thanks,
Carlos

--
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/spyderlib?hl=en.

Reply via email to